liizbenson4869 liizbenson4869
  • 29-06-2019
  • Computers and Technology
contestada

In order to "print" the data in an object, the class should override the _____ method.

String
toString
StringValue
Value

Respuesta :

waqasshakirsatti123
waqasshakirsatti123 waqasshakirsatti123
  • 29-06-2019

Answer:

toString is right Answer

Explanation:

If you want to represent any object as a string, toString() method comes into existence.  

The toString() method returns the string representation of the object.

If you print any object, java compiler internally invokes the toString() method on the object. So overriding the toString() method, returns the desired output, it can be the state of an object etc. depends on your implementation.

Answer Link

Otras preguntas

Which of the following units is a derived unit? Second Meter Density Ampere
explain how to use a number line to find the Opposites of the integers 3 units away from negative 7
how to write a paper on a doctor saying a patiet is brain dead
Why did George Washington make the risky move of crossing the Delaware river
which statement is trueA. 0.121212... is an irrational number.B. 0.34353637 is an irrational number.C. 8.14 is an integer.D. 5.12345 is an irrational number
What primary advantage do objects have over pictures ?
Tenths and Hundredths write each fraction or mixed number as a decimal 1/5=
add the correct punciation Jason reported only 1% of the Earth,s water is fresh
what's the answer to this fraction?
Which was a factor that led to Bacon’s Rebellion? A. American Indians were moving closer and closer to the coasts. B. Indentured servants were encroaching on A