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.

  1. how possible when class not exist physically?

  2. when memory created these variables?

  3. 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

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -