NEW
Font size
WorksheetsMastering Java Arithmetic Operators
Total questions: 10
Worksheet time: 5mins
What is the result of 10 + 5?
10
20
15
5
Which operator is used for division in Java?
*
%
/
-
What will be the result of 10 % 3?
0
3
10
1
If a = 5 and b = 2, what is the value of a - b * 2?
0
1
10
3
What is the precedence of the multiplication operator (*) compared to addition (+)?
Multiplication (*) has higher precedence than addition (+).
Addition (+) has higher precedence than multiplication (*).
Multiplication (*) and addition (+) have the same precedence.
Multiplication (*) has lower precedence than addition (+).
How do you declare a variable in Java?
declare variableName as dataType;
To declare a variable in Java, use the syntax: dataType variableName; or dataType variableName = value;
variableName dataType;
dataType = variableName;
Which of the following is a valid data type in Java?
Boolean
Character
Integer
String
What will be the output of 15 / 4 in Java?
3
4
2
3.75
What is the result of 14 * 7 % 2 – 5?
9
-32
-5
20
Which of the following is NOT a primitive data type in Java?
String
int
float
char
