1. Which component is responsible to optimize bytecode to machine code?
Explanation: JIT optimizes bytecode to machine specific language code by compiling similar bytecodes at the same time. This reduces overall time taken for compilation of bytecode to machine specific language.
2. What is the extension of java code files?
Explanation: Java files have .java extension
3. What is use of interpreter?
a) They are intermediated between JIT and JVM
b) They read high level code and execute them
c) They convert bytecode to machine language code
d) It is a synonym for JIT
Explanation: Interpreters read high level language (interprets it) and execute the program.
4. What is the extension of compiled java classes?
Explanation: The compiled java files have .class extension
5. Which component is used to compile, debug and execute java program?
Explanation: JDK is a core component of Java Environment and provides all the tools, executables and binaries required to compile, debug and execute a Java Program.
6. Which statement is true about java?
a) Platform independent programming language
b) Platform dependent programming language
c) Code dependent programming language
d) Sequence dependent programming language
Explanation: Java is called platform independent language as it primarily works on the principle of ‘compile once, run everywhere’.
7. Which concept of Java is achieved by combining methods and attribute into a class?
Explanation: Encapsulation is implemented by combining methods and attribute into a class. The class acts like a container of encapsulating properties.
8. Which component is responsible to run java program?
Explanation: JRE is the implementation of JVM, it provides platform to execute java programs.
9. Which of the below is invalid identifier with the main method?
Explanation: main method cannot be private as it is invoked by external method. Other identifier are valid with main method.
10. Which component is responsible for converting bytecode into machine specific code?
Explanation: JVM is responsible to converting bytecode to the machine specific code.