Question: The class Tweet represents a single tweet. Data: A Tweet should contain the text content of the Tweet, a reference to the User who authored

The class Tweet represents a single tweet.

Data: A Tweet should contain the text content of the Tweet, a reference to the User who authored the tweet, the count of likes the tweet has, and a unique id for the Tweet represented as a String.

Constructor: A standard constructor that takes a value for each field and initializes it

Methods:

boolean longerThan(Tweet other)

Takes a Tweet, and returns true if the content of this one is longer (has more characters) than the content of other.

boolean moreLikes(Tweet other)

Takes a Tweet, and returns true if the number of likes of this is more than the likes of other.

String toText()

Returns a String that represents the Tweet object with all the User information as text, and also displays the tweet content and likes. The returned string should have the toText of the user followed by the content, followed by the number of likes, as in this example: "Julia Evans @b0rk : when debugging, your attitude matters : 468 Likes"

String toLink()

This method returns a string representing the URL for the Tweet object

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!