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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started