java - How variables are created inside a class when the class is not real? -
i have read class model creating objects , does not exist physically whereas objects real. creating variables inside class , manipulating them.
how possible when class not exist physically?
when memory created these variables?
where memory created these variables?
if mean static class variables, quaranteed initualized , static initialization code inside class quaranteed run, before class used. when, not specified iirc, , different jvms may @ different time. same thing global variables in languages have those.
so reiterate: static stuff exists , initialized before first used. jvm implementation takes care of that.
but there object: instance of class object, subclass of class class.
addition: in fact, in java classes exist concretely, can serialized, transferred on network different jvm, deserialized there, objects of class created there , code executed. simple example of vanilla java applets running in browser. example slave nodes in jenkins/hudson ci system, slave program small , contains code receive, deserialize , instantiate both classes , objects of these classes, sent master server they're connected to.
Comments
Post a Comment