Question: |Assignment 3 Twitter DB class should have the following constructor: public Twitter DB(String comment) The constructor sets the comment instance variable. It also creates an


|Assignment 3 Twitter DB class should have the following constructor: public Twitter DB(String comment) The constructor sets the comment instance variable. It also creates an empty AnayList object tweets. The objective of this assignment is to learn and apply use of Java's Arras List class to user defined objects. The set of classes will include Tweet Tweet DB, and a Tester class. Description: Tweet Class Tweet class would implement comparable interface. Therefore, tweet objects can be sorted based on Date-time. The Tweet class stores information about the tweet. Tweet class has following data members: private String userID: 1/ stores the user id private Date date; // convert the date-time string to a java.util.Date format private String tweet; // stores the tweeted message The Tweet class should have the following constructor: public Tweet (String userID. String dateTime. String tweet) This constructor takes three strings for user id, date-time and text. Set the values using mutators. The String dateTime should be converted to a java.util.Date Twitter DB class should implement the following methods: - Accessor and mutator for comment data member. public void addTweet Tweet tweet) This method adds the tweet passed as the argument to the tweets Antas List public int getNumberOfTweets:0 This method retums the number of tweets stored in the tweets ArrayList public Tweet getTweet(int) Returns the i tweet in the tweets Away List public ArrayList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
