Ask Question
2 April, 22:59

If you write a toString method to display the contents of an object, object1, for a class, Class1, then the following two statements are equivalent: System. out. println (object1); System. out. println (object1. toString ()); A. True B. False

+1
Answers (1)
  1. 3 April, 02:11
    0
    The answer is "Option A".

    Explanation:

    In the given question the method toString () is used that converts any value into a string. In this code two print method is used, that can be described as follows:

    In the first method, object1 is created, which is used to print all object values. In the second method, object1 uses the toString () method, which converts all values into a string, that's why the answer to this question is "True".
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “If you write a toString method to display the contents of an object, object1, for a class, Class1, then the following two statements are ...” 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