+ 4

When an object is passed to System.out.println as an argument it prints some hashcode, what does this hashcode represent?

6th Jan 2018, 5:38 PM
Dhvani
Dhvani - avatar
2 Answers
+ 6
package.class@adress in memory of that object. If you want to print something different for your object you need to override toString() method in class which object belongs
6th Jan 2018, 5:48 PM
Vukan
Vukan - avatar