• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to see java.lang.Thread Source

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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.


 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
find the src.zip under your jdk installation directory , and extract it .
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20610
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the language specification. int, double, etc are not Objects, they are something totally different.
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 607
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.)
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Sam , thats great explanation . Thank you very much .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic