Win a copy of The Java Performance Companion this week in the Performance 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
Pie
Posts: 49433
62
  • 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