SQL

Friday, 14 August 2015

toString() in Java

Method toString()

All object has a toString method that returns the string representation of that object. When an object is concatenated with a string, the object's toString is implicitly called to obtain the string representation of that object. toString also can be called explicitly.

Example:


Output:

X=10 Y=10
X=10 Y=10 testing

Post a Comment