OCA Java SE 8 Building Blocks - OCA Mock Question Building Block 13








Question

Which of the following are true? (Choose all that apply)

  1. javac compiles a .class file into a .java file.
  2. javac compiles a .java file into a .bytecode file.
  3. javac compiles a .java file into a .class file.
  4. Java takes the name of the class as a parameter.
  5. Java takes the name of the .bytecode file as a parameter.
  6. Java takes the name of the .class file as a parameter.




Answer



C, D.

Note

Java puts source code in .java files and bytecode in .class files.

Java does not use .bytecode as file extension name for compiled source code.

When running a Java program, you pass just the name of the class without the .class extension.