Lecture-16 Object Class and ToString Method
Lecture-16 Object Class and ToString Method
4-2
toString() Method
• toString() method is instance method of Object Class
• Signature of toString(): public String toString()
• Invoking toString() on an object returns a string that
describes the object
Loan loan = new Loan();
Loan@15037e5
System.out.println(loan.toString());