Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java compiled or interpreted ?

 
Manas Ahlaad
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is java a compiled language or interpreted language ?
 
Arun Boraiah
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
source code -> bit code -> which run time interpreated and code gets executed. Will this answer your question?
-arun
 
Prashant Neginahal
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's both man.Compiler and Interpreter are not about any languages ,these are the tools which assist high level language to talk with OS.
Yes, w.r.t java both comes into picture. Compiler converts source code(.java) into bytecode form(.class)which is OS independent.Then, interpreter interpretes byte code and converts it into machine level w.r.t.underlying OS.
Prashant.
 
Manas Ahlaad
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you mean compiler gives byte code from source code and then interpreter executes it at runtime?
in that case can we call it as a compiled language? since runtime it may be interpreted or compiler (hotspot does comilation at runtime also i.e all at one chunk).
 
girish rateshwar
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi manas,
Java is a compiler as well as an interpretor based language.
What gives java its platform independance is the byte code which runs in the JVM. (remember it is the interpretor which executes the .class file in the JVM)
So <filename>.java--compiled-->><filename>.class--interpreted in the JVM-->> Execution
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic