WorksheetsTalent Next Java MCQ-1
Total questions: 10
Worksheet time: 10mins
Which is the portability and security cause in Java?
The applet makes the Java code secure and portable
Bytecode is executed by JVM
handling Dynamic binding between objects
Use of exception
Which of the following is not a Java features?
Dynamic
Architecture Neutral
Object-oriented
Use of pointers
Which component is responsible to run java program?
JVM
JDK
JIT
JRE
Which of the below is/are valid identifier with the main method?
public
private
static
this
What is the extension of java code files?
.class
.txt
.java
.js
Converting real world objects in terms of class in java?
Polymorphism
Encapsulation
Abstraction
Inheritance
1. class main_class
2. {
3. public static void main(String args[])
4. {
5. int y = 10;
6. if (y == 10)
7. {
8. int y = 11;
9. System.out.println(y);
10. }
11. }
12. }
Compilation error
10
11
Run time error
class KIET_Test {
int x;
}
class Main {
public static void main(String args[]) {
KIET_Test t = new KIET_Test();
System.out.println(t.x);
}
}
garbage value
0
compiler error
runtime error
Which of the following is a valid declaration of an object of class Box?
Box obj = new Box;
Box obj = new Box();
obj = new Box();
new Box obj;
Which of these operators is used to allocate memory for an object?
malloc
alloc
new
this
