// import the Arrays package here: import java.util.Arrays; public class Newsfeed { public Newsfeed(){ } public String[] getTopics(){ String[] topics = {"Opinion", "Tech", "Science", "Health"}; return topics; } public static void main(String[] args){ Newsfeed sampleFeed = new Newsfeed(); String[] topics = sampleFeed.getTopics(); System.out.println(Arrays.toString(topics)); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter