Results 1 to 9 of 9
- 03-24-2014, 09:20 AM #1
Senior Member
- Join Date
- Mar 2014
- Posts
- 286
- Rep Power
- 7
What is a Class object, not the class named "Object"
This statement is given here.
"You might wonder what happens when a static synchronized method is invoked, since a static method is associated with a class, not an object. In this case, the thread acquires the intrinsic lock for the Class object associated with the class. "
What is a Class object associated with a class. Google search rather finds material about the Object class. I'm sure it is not that.
- 03-24-2014, 09:44 AM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,568
- Rep Power
- 15
Re: What is a Class object, not the class named "Object"
Class is a class like every other. Whenever a new class is loaded (i.e. referenced for the first time in a program) the Class class, defining the class itself, is instantiated, before instantiating any instances of the what the class defines. All static items are referenced from this instance of Class.
- 03-24-2014, 10:48 AM #3
Just a guy
- Join Date
- Jun 2013
- Location
- Netherlands
- Posts
- 5,114
- Rep Power
- 13
- 03-24-2014, 11:00 AM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
Re: What is a Class object, not the class named "Object"
Build a wall around Donald Trump; I'll pay for it.
- 03-24-2014, 11:49 AM #5
Senior Member
- Join Date
- Mar 2014
- Posts
- 286
- Rep Power
- 7
Re: What is a Class object, not the class named "Object"
@masijade Thank you very much.
- 03-24-2014, 01:56 PM #6
Just a guy
- Join Date
- Jun 2013
- Location
- Netherlands
- Posts
- 5,114
- Rep Power
- 13
Re: What is a Class object, not the class named "Object"
"Syntactic sugar causes cancer of the semicolon." -- Alan Perlis
- 03-24-2014, 05:43 PM #7
Moderator
- Join Date
- Apr 2009
- Posts
- 13,541
- Rep Power
- 27
- 03-24-2014, 05:44 PM #8
Just a guy
- Join Date
- Jun 2013
- Location
- Netherlands
- Posts
- 5,114
- Rep Power
- 13
Re: What is a Class object, not the class named "Object"
I think it would just get shortened to 'Monster' myself.
"Syntactic sugar causes cancer of the semicolon." -- Alan Perlis
- 03-24-2014, 09:11 PM #9
Senior Member
- Join Date
- Feb 2014
- Posts
- 219
- Rep Power
- 8
Re: What is a Class object, not the class named "Object"
Further reading for Zarah on the Class object:
You know you've sorted this out when you know the differences between a Class class, Class object, Object class and Object object. ;-) (Hmm... looks like a good interview question...)
Similar Threads
-
Class "object cannot be resolves to a type"
By Bitterguy in forum New To JavaReplies: 6Last Post: 08-23-2012, 03:23 PM -
Problems Class.forName("oracle.jdbc.driver.OracleDriver"); working only in one Class
By jokobe in forum New To JavaReplies: 6Last Post: 02-08-2012, 07:42 PM -
Drawing an object in my canvas class, the object is created in a separate class
By Hornfreak in forum AWT / SwingReplies: 3Last Post: 05-02-2011, 05:37 AM -
How to inherit "Object" class in Java
By Ipsita in forum Advanced JavaReplies: 5Last Post: 04-08-2011, 01:37 PM -
lock on ".class" object
By rajinder5 in forum Threads and SynchronizationReplies: 0Last Post: 10-11-2010, 05:38 PM
Bookmarks