Java: nested class function? -
ob instance of object.
if call function getname returns class type
ob.getclass().getname()
my doubt is, how come getclass , getname 2 functions, how nested?
no, aren't. getclass
return class
object. class
object contains method called getname
. code posted similar to:
class cls = ob.getclass(); string name = cls.getname();
Comments
Post a Comment