Which command is used to convert the code written in Java to bytecode?
2024
Which command is used to convert the code written in Java to bytecode?
- A.
javap
- B.
java
- C.
javadoc
- D.
javac
- E.
Question not attempted
Attempted by 197 students.
Show answer & explanation
Correct answer: D
In Java, the javac command is used to compile Java source code (.java files) into bytecode (.class files).
Bytecode is the intermediate code executed by the Java Virtual Machine (JVM).
Example:
javac Program.javaAfter compilation:
Program.classis generated, which contains Java bytecode.
Therefore, javac is the command used to convert Java code into bytecode.