• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

private, public, protected

 
Saibabaa Pragada
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 20882
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
Anchit Herredia
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 20882
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic