Imagine there is a class Employee. We create an object of EmployeeEmployee a= New Employee();If we are givingSystem.out.println(a);What gets printed?

It gives the memory location of Employee object.

Questions by AjayReddy   answers by AjayReddy

Showing Answers 1 - 6 of 6 Answers

devs

  • Feb 10th, 2006
 

it gives the classname and the memorylocation Eg:Employee@187c6c7 where 187c6c7 is the memory location.

  Was this answer useful?  Yes

suma

  • Feb 13th, 2006
 

It creats a Employee object at runtime & points to that location

  Was this answer useful?  Yes

jay

  • Sep 17th, 2006
 

actually only ravi gave the exact answer : memory location of Employee object is the default behavior of toString() method inherited by universal Object class

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions