Essay
Assume the class Student implements the Speaker interface from the textbook. Recall that this interface includes two abstract methods, speak( ) and announce(String str). A Student contains one instance data, String classRank. Write the Student class so that it implements Speaker as follows. The speak method will output "I am a newbie here" if the Student is a "Freshman", "I hate school" if the Student is either a "Sophomore" or a "Junior", or "I can not wait to graduate" if the student is a "Senior". The announce method will output "I am a Student, here is what I have to say" followed by the String parameter on a separate line. Finally, the classRank is initialized in the constructor. Only implement the constructor and the methods to implement the Speaker interface.
Correct Answer:

Verified
public class Student implements Speaker
...View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Correct Answer:
Verified
...
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q6: Java does not support multiple inheritance but
Q29: As described in the Software Failure, the
Q30: Although classes can be inherited from one-another,
Q32: If a class extends Applet and also
Q33: The instruction super( ); does which of
Q35: Consider a class Name, which has four
Q36: What is the advantage of extending an
Q37: In order to determine the type that
Q37: Consider an applet that implements MouseListener. Assume
Q39: An Applet implements MouseMotionListener and is 600x600