wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Mastering Java Arithmetic Operators

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What is the result of 10 + 5?

a)

10

b)

20

c)

15

d)

5

2.

Which operator is used for division in Java?

a)

*

b)

%

c)

/

d)

-

3.

What will be the result of 10 % 3?

a)

0

b)

3

c)

10

d)

1

4.

If a = 5 and b = 2, what is the value of a - b * 2?

a)

0

b)

1

c)

10

d)

3

5.

What is the precedence of the multiplication operator (*) compared to addition (+)?

a)

Multiplication (*) has higher precedence than addition (+).

b)

Addition (+) has higher precedence than multiplication (*).

c)

Multiplication (*) and addition (+) have the same precedence.

d)

Multiplication (*) has lower precedence than addition (+).

6.

How do you declare a variable in Java?

a)

declare variableName as dataType;

b)

To declare a variable in Java, use the syntax: dataType variableName; or dataType variableName = value;

c)

variableName dataType;

d)

dataType = variableName;

7.

Which of the following is a valid data type in Java?

a)

Boolean

b)

Character

c)

Integer

d)

String

8.

What will be the output of 15 / 4 in Java?

a)

3

b)

4

c)

2

d)

3.75

9.

What is the result of 14 * 7 % 2 – 5?

a)

9

b)

-32

c)

-5

d)

20

10.

Which of the following is NOT a primitive data type in Java?

a)

String

b)

int

c)

float

d)

char