Ask Question

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?

+4
Answers (1)
  1. 12 March, 10:55
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers