Ask Question
11 June, 01:57

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. 11 June, 02:43
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers