Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Beginning Java and the fly likes How to see java.lang.Thread Source Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to see java.lang.Thread Source" Watch "How to see java.lang.Thread Source" New topic
Author

How to see java.lang.Thread Source

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234



Hi ,

Please tell me this :



How can i see a java.lang.Thread Source ?

What is the name of the jar file i need to extract ?

Thanks in advance.



Save India From Corruption - Anna Hazare.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

find the src.zip under your jdk installation directory , and extract it .
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Thank you very much .

I am not afraid to ask this question in Java Beginer Forum .

I have gone through source code of Object.java under lang package . I couldn't find any variables in it . So from where does all these primitive types come from ??
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19723
    
  20

From the language specification. int, double, etc are not Objects, they are something totally different.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Thank you Rob .

I agree that they are something different and not related to Object class .

But can you please tell me then how they are related to Java ?
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 606

The native types are not Objects. They are probably implemented somewhere in the JVM code (Native code).
There is usually a lot of debate whether the primitive type should be Objects or native. Making them Object is a overhead that the Java team decided to avoid. Instead the provided the wrapper class for each of the native types - that could be used with say Collections that did not support native types (autoboxing changes these rules a bit ).

So if you looking for where the 'int' 'float' are implemented you might have to go look at the JVM code (Actually i am not 100% on this.)


Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hey Sam , thats great explanation . Thank you very much .
 
Don't get me started about those stupid light bulbs.
 
subject: How to see java.lang.Thread Source