aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes private, public, protected Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "private, public, protected" Watch "private, public, protected" New topic
Author

private, public, protected

Saibabaa Pragada
Ranch Hand

Joined: Oct 24, 2010
Posts: 162
Hi, Is there anyway we can see the underlying implementation for access specifiers & modifiers like "private, public, protected, native, synchronized, abstract etc..". For classes and methods we have API and can see how Sun/Oracle implemented.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18990
    
  40


If you really want to, I guess you can get the source code for the JVM from open source. Google for "openjdk".

Be warn though, the code is complex. And written mostly in C and C++.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Anchit Herredia
Greenhorn

Joined: Jul 15, 2009
Posts: 26
Henry Wong wrote:
If you really want to, I guess you can get the source code for the JVM from open source. Google for "openjdk".

Be warn though, the code is complex. And written mostly in C and C++.

Henry


But does that mean that any program written in Java will be slower than the same one written in C++?

(Can't believe Java was written using the shitty C++)
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18990
    
  40

Anchit Herredia wrote:
But does that mean that any program written in Java will be slower than the same one written in C++?


Using the same argument, you can say that assembly language is slower than C, because most assemblers are written in C.... well, assembly is arguable slower, but for a different reason

Remember, Java not only has a compiler (that optimizes), but the JVM has multiple just-in-time compilers that optimizes too. Comparing the speed of two compiled programs based on the language used for the compiler is not very valid.


Anchit Herredia wrote:
(Can't believe Java was written using the shitty C++)


Having worked with C++ for many years, and still working with it, I will be the first to say that the language has many warts.... but it is far from a "shitty" language". In fact, I would still list it as one of my favorites.

Henry
 
Consider Paul's rocket mass heater.
 
subject: private, public, protected