Ask Question
1 February, 13:55

Suppose the abstract class Message is defined belowpublic abstract class Message{private String value; public Message (String initial) {value = initial; }public String getMessage () {return value; }public abstract String translate (); }A concrete subclass of Message, called FrenchMessage, is defined. Which methods must FrenchMessage define?

+3
Answers (1)
  1. 1 February, 17:30
    0
    The answer is "translate () only".

    Explanation:

    In the given statement some information is missing, which is the option of the question, that can be defined as follows:

    A) translate () only.

    B) getMessage () only.

    C) The FrenchMessage constructor and translate () only

    D) The FrenchMessage constructor, getMessage (), and translate ().

    In the given statement, only translate () method is used, because in the statement it is declared that, it is an abstract method, which is only declared in the class not defined, that's why option a is correct and other were wrong, which can be explained as follows:

    In option B, this method is used to return copy constructor value, that's why it is wrong. Option C and Option D is wrong because it uses other methods.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Suppose the abstract class Message is defined belowpublic abstract class Message{private String value; public Message (String initial) ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers