/** * Inheritance Example * socialnetwork Module * Source code file: TestPost.java * Test the Post, MessagePost, PhotoPost, and * NewsFeed classes. */ public class Test { public static void main(String[] args) { NewsFeed myfeed = new NewsFeed( ); Post post1 = new Post("steve"); post1.addComment("Comment 1"); post1.addComment("Comment 2"); post1.like( ); post1.like( ); myfeed.addPost(post1); MessagePost post2 = new MessagePost("judy", "I cooked Chicken Cacciatore for dinner."); post2.addComment("Comment 3"); post2.like( ); post2.like( ); post2.addComment("Comment 4"); post2.addComment("Comment 5"); post2.like( ); post2.like( ); myfeed.addPost(post2); PhotoPost post3 = new PhotoPost("alice", "hollywood-sign.jpg", "All of us by the Hollywood sign."); post3.addComment("Comment 6"); post3.like( ); post3.like( ); post3.addComment("Comment 7"); myfeed.addPost(post3); myfeed.show( ); } }