wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Fun with Java!!

Total questions: 15

Worksheet time: 7mins

Name
Class
Date
1.

Statement used to check multiple conditions in Java.

a)

if-else

b)

if-else-if ladder

c)

switch case

d)

if statement

2.

Statements which allow the control to jump to a specific location in Java depending upon the condition

a)

Selection statements

b)

Jumping statements

c)

Looping statements

d)

None of the above

3.

The logical statement where either of the two situations are executed

a)

if

b)

if-else-if

c)

switch case

d)

if-else

4.

Technique of binding of data and functions is called ...

a)

Abstraction

b)

Polymorphism

c)

Class

d)

Encapsulation

5.

________ are the special symbols used to perform calculations or oerations

a)

Expressions

b)

Operator

c)

Operand

d)

Data type

6.

The reserved words of java are called_____

a)

Token

b)

Data Type

c)

Keyword

d)

Constants

7.

Data type used to store single character constant in java

a)

String

b)

string

c)

int

d)

char

8.

The process by which objects of one class acquire property of another class is called ___________

a)

Abstraction

b)

Encapsulation

c)

Inheritance

d)

Polymorphism

9.

While comparing two values their data type should be different

a)

True

b)

False

10.

The messages to be printed as output Java should be in ________ in the program

a)

:

b)

;

c)

+

d)

" "

11.

If you want to increase the value of variable a after evaluation of equation. The correct way of writing variable a is-

a)

++ a

b)

--a

c)

a++

d)

a--

12.

To check whether the value of variable b is greater than 10 or not, the equation can be written

if(!(b>10)

a)

True

b)

False

13.

To Check whether a number n is divisible by 3 or not.

The equation can be written as

a)

if(X/3)

b)

if(x%3)

c)

if(x/3==0)

d)

if(x%3==0)

14.

To find the average of three numbers in Java which statement is correct

a)

a+b+c/3

b)

(a+b+c)/3

c)

Both a and b

d)

Only b

15.

A java program is compiled into an intermediate code called Byte code using

a)

Java Compiler Machine

b)

Java Source Machine

c)

Java Virtual Machine

d)

Java Interpreer Machine