wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Java Programming

Total questions: 15

Worksheet time: 5mins

Name
Class
Date
1.

Java programs are

a)

Faster than others

b)

Platform independent

c)

Not reusable

d)

Not sacable

2.

Java has its origin in

a)

COBOL

b)

PERRL

c)

Oak programming language

d)

C language

3.

Which one of the following is true for java

a)

Java is object oriented and interpreted

b)

Java is efficient and faster than C

c)

Java is the choice of everyone

d)

Java is not robust

4.

The command javac is used to

a)

Execute a Java program

b)

Compile a Java program

c)

Debug a Java program

d)

Interpret a Java program

5.

……………. are not machine instructions and therefore, Java interpreter generates machine code that can be directly executed by the machine that is running the Java program.

a)

Compiled instruction

b)

Compiled code

c)

Byte code

d)

Java mid code

6.

Which of the following is not the Java primitive type

a)

Byte

b)

Float

c)

Character

d)

Long double

7.

Which of the following is true about Java.

a)

Java does not support overloading.

b)

Java has replaced the destructor function of C++

c)

There are no header files in Java.

d)

All of the above

8.

All Java classes are derived from

a)

java.lang.Class

b)

java.util.Name

c)

java.lang.Object

d)

java.awt.Window

9.

Which of the following is not mandatory in a variable declaration?

a)

a semicolon

b)

an identifier

c)

an assignment

d)

a data type

10.

What would happen if “String[]args” is not included as an argument in the main method?

a)

No error

b)

Compilation error

c)

The program won’t run

d)

Program exit

11.

In Java variables, if first increment of the variable takes place and then the assignment occurs. This operation is also called…………………………

a)

pre-increment

b)

post-increment

c)

incrementation

d)

pre incrementation

12.

The compiled Java program can run on any ………………… platform having Java Virtual Machine (JVM) installed on it.

a)

Program

b)

Hardware

c)

Java

d)

Non java

13.

The information written in java after // is ignored by the

a)

Programmer

b)

Interpreter

c)

Compiler

d)

All of the above

14.

When the operators are having the same priority, they are evaluated from …………….. …………. in the order they appear in the expression.

a)

right to left

b)

left to right

c)

Any of the order

d)

Depends on the compilor

15.

State true or false for Java Program.

i) All class variables are instance variables

ii)An abstract class has implementations of all methods defined inside it.

a)

i-false, ii-false

b)

i-false, ii-true

c)

i-true, ii-false

d)

i-true, ii-true