This homework will help you learn how to solve problem with multiple Java classes.
The objectives of this week are following:
- Programming abstraction of simple enrollment system.
- Learn more about class composition relationship.
- Using constructor to initialized class data type.
- Using "this" and "super" keywords.
##Post Class
- Base class for user post
##MessagePost Class
- One of Post's subclasses.
- Represent a message post which contains a single message for each post.
##PhotoPost Class
- One of Post's subclasses.
- Represent a photo post which contains filename of a photo and a caption for the photo.
- the photo file must be .jpg or .png.
##NewsFeed Class
- Represent a single news feed.
- Each news feed contains multiple posts.
- Each post can be message or photo.
##TestPost1 Class
- A test program which gives a result as those stored in the "TestPost1-output.txt" file
To complete the homework you need to meet following requirements:
- Output from the "TestPost1.java" program should be the same as or very similar to the output stored in the "TestPost1-output.txt".
- Draw a class and object diagram showing the relationship among the classes and objects.