Question: How would I code these three classes? Also, could you put in comments to explain your logic behind designing the class that way. I want



How would I code these three classes? Also, could you put in comments to explain your logic behind designing the class that way. I want to have a better understanding of correct syntax.
The set of classes will include Tweet, TweetDB, 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; // 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. The Tweet class must implement the following methods: - Mutator an accessor for every data member. Check appropriate exception here. public String toString 0 This method returns a string containing user id, date of tweet and tweet text. public boolean equals(Object other) For this assignment, consider two tweets are equal if the tweeted text are equal public int compareTo(Tweet o) Override compareTo() method to compare two tweet objects based on their Date-time. TweetDB Class The TwitterDB class keeps a database of tweets. This class should have the following data members: private String comment; // describes the contents of the tweets database private ArrayList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
