This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which happen Intrepreter and compiler??

 
Dhineshkumar raj
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the life cycle of JVM ??

As we know the following,
Java is both compiler and Interpreter
Java is a just-in time compiler.

javac classname.java

// using this command am compiling my code. It means JVM converts the normal Unicode(.java file) into bytecode(.class file) right??

Now when will the interpreter takes its turn ?? Before making the .class file or after making .class ??

Regards
Dhinesh
 
Campbell Ritchie
Sheriff
Posts: 48440
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dhineshkumar raj:
javac classname.java

. . . It means JVM converts the normal Unicode(.java file) into bytecode(.class file) right??

Now when will the interpreter takes its turn ?? Before making the .class file or after making .class ??

Regards
Dhinesh
Yes, javac converts an ASCII or Unicode plain text file to bytecode.
The interpreter is called "java" and it takes its turn when you write "java classname". If there is frequently-used code the JIT compiler may compile that from bytecode into machine code to optimise performance.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic