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?

  1. A.

    javap

  2. B.

    java

  3. C.

    javadoc

  4. D.

    javac

  5. 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.java

After compilation:

Program.class

is generated, which contains Java bytecode.

Therefore, javac is the command used to convert Java code into bytecode.

Explore the full course: Up Lt Grade Assistant Teacher 2025