TOTAL QS = 20Time [ 00 : 00 : 00 ]
00:00:00

Java Basics: Arithmetic Operators Online Test 1

Instructions

Total Questions: 20

Total Minutes: 20

This ExamTray Free Online Exam/Quiz/Trivia tests your Java Programming Skills on Java Arithmetic Operators. Questions about Priority are also given. This test displays answers after finishing the exam for review. You can easily clear Competitive Exams and Job Interview Questions.

Go through Java Theory Notes on Arithmetic Operators before attempting this test.

All the Best

Challenge SCORE

0 / 20

Take This Exam
1) An Arithmetic expression in Java involves which Operators or Operations?
2) Choose the Compound Assignment Arithmetic Operators in Java below.
3)
What is the output of the below Java code snippet?
int a = 2 - - 7;
System.out.println(a);
4)
What is the output of Java code snippet below?
short p = 1;
short k = p + 2;
System.out.println(k);
5)
What is the output of Java code snippet?
short k=1;
k += 2;
System.out.println(k);
6)
What is the output of the Java code snippet?
int a=5, b=10, c=15;
a -= 3;
b *= 2;
c /= 5;
System.out.println(a +" " + b + " " + c);
7)
How do you rewrite the below Java code snippet?
int p=10;
p = p%3;
8) Which is the arithmetic operator in Java that gives the Remainder of Division?
9) Arithmetic operators +, -, /, *  and % have which Associativity?
10) Between Postfix and Prefix arithmetic operators in Java, which operators have more priority?
11) Among Postfix Decrement and Prefix Increment operators in Java, which operator has less priority?
12) Increment and Decrement arithmetic operators in Java has which Associativity?
13) Choose the correct statement about Java Operators +, -, *, / and %.
14) Among the operator groups (++, --) and (+, -, *, /, %) in Java, which group has higher priority? 
15)
What is the output of the Java code snippet?
int a=10, b=6;
int c = a+b*5;
System.out.println(c);
16)
What is the output of the Java code snippet?
int a=10, b=5, c=3;
int d = a+c/2*b;
System.out.println(d);
17)
What is the output of the Java code snippet?
int a=5, b=6;
if(a++ == --b)
{
  System.out.println("5=5");
}
else
{
  System.out.println("NONE");
}
18)
What is the output of the Java code snippet?
int a=6, b=5;
if(++b == a--)
{
  System.out.println("RABBIT");
}
else
{
  System.out.println("BUNNY");
}
19)
What is the output of the Java code snippet?
int a=10, b=20;
int c = a++*2;
int d = --b*2;
System.out.println(c +"," + d);
20) Choose the correct statement about Java Prefix and Postfix operations.
Certification Group ID
3845

Open Certification Helper Popup Reset Popup