Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Talent Next Java MCQ-1

Total questions: 10

Worksheet time: 10mins

Name
Class
Date
1.

Which is the portability and security cause in Java?


a)

The applet makes the Java code secure and portable

b)

Bytecode is executed by JVM

c)

handling Dynamic binding between objects

d)

Use of exception

2.

Which of the following is not a Java features?

a)

Dynamic

b)

Architecture Neutral

c)

Object-oriented

d)

Use of pointers

3.

Which component is responsible to run java program?

a)

JVM

b)

JDK

c)

JIT

d)

JRE

4.

Which of the below is/are valid identifier with the main method?

a)

public

b)

private

c)

static

d)

this

5.

What is the extension of java code files?

a)

.class

b)

.txt

c)

.java

d)

.js

6.

Converting real world objects in terms of class in java?

a)

Polymorphism

b)

Encapsulation

c)

Abstraction

d)

Inheritance

7.

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. }

a)

Compilation error

b)

10

c)

11

d)

Run time error

8.

class KIET_Test {

int x;

}

class Main {

public static void main(String args[]) {

KIET_Test t = new KIET_Test();

System.out.println(t.x);

}

}

a)

garbage value

b)

0

c)

compiler error

d)

runtime error

9.

Which of the following is a valid declaration of an object of class Box?

a)

Box obj = new Box;

b)

Box obj = new Box();

c)

obj = new Box();

d)

new Box obj;

10.

Which of these operators is used to allocate memory for an object?

a)

malloc

b)

alloc

c)

new

d)

this