what is the difference between
roseIndiaObject.getClass() returns the runtime class
and
roseIndiaObject.getClass().getName() gets the class name of the created object at runtime.
Another wayNagaraju GUnji February 6, 2012 at 3:35 PM
The whole point of getting an object's class name at runtime is when you do not know the object's class name before hand. This example creates a class RoseIndia, then creates an instance of the class, then does the roseIndiaObject.getClass().getName());
So what? Yes, we have shown how to call the method, but this is not how the method is used. The purpose of the method is to getName() of something we don't know the name of.
How do we determine an object's class name when we don't know the object's type before runtime! That is the question that needs answered here.
Doubt on getClass()naresh pallothu October 12, 2011 at 11:42 AM
what is the difference between roseIndiaObject.getClass() returns the runtime class and roseIndiaObject.getClass().getName() gets the class name of the created object at runtime.
Another wayNagaraju GUnji February 6, 2012 at 3:35 PM
RoseIndia.class.getName() is another ways.
get Object class name at runtime Ted S March 19, 2012 at 1:21 AM
The whole point of getting an object's class name at runtime is when you do not know the object's class name before hand. This example creates a class RoseIndia, then creates an instance of the class, then does the roseIndiaObject.getClass().getName()); So what? Yes, we have shown how to call the method, but this is not how the method is used. The purpose of the method is to getName() of something we don't know the name of. How do we determine an object's class name when we don't know the object's type before runtime! That is the question that needs answered here.
JavaCruze July 3, 2012 at 6:44 PM
Can you please further explain: roseIndiaObject.getClass().getName()
How can i display the name of calling ObjectArsalan October 10, 2012 at 5:21 AM
how can i display the name of calling object eg in the above mentioned case how can i display roseIndiaObject ?? Thanks in advance :)
learning JAVA...!karthick January 3, 2013 at 4:26 PM
HI JAVA teams gd eve... has i am learning basic java language what.?
Post your Comment