Q) Compiler converts
- Java program to byte code
- Java program to machine code
- Java program to octal code
- Java program to hexadecimal code
Answer: 1
Compiler compile java program and convert in byte code (class file) and interpreter convert byte code to machine code.
Q) Which one is reference type?
- Int
- Float
- Double
- Class
Answer: 4
Int, float and double all are primitive type and a class is of reference type
Q) True statements about object of Insurance class is/are
class Insurance{
int policyNumber;
}
public class Bank {
public static void main(String[] args) {
Insurance policy = new Insurance();
}
}
- Class object will be garbage collected when it goes out of scope from main ()
- In the middle of main () function, class object can also be set for garbage collection by using statement “policy = NULL;”
- Both A & B are true
- None
Answer: 3
Q) ____________ provides run time environment for java byte code to be executed
- JDK
- JRE
- JVM
- JAVAC
Answer: 3