ExamTray App is now Available on Google Play EXAMTRAY android app link

 

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

Java Basics: Relational Operators Online Test 1

Instructions

Total Questions: 12

Total Minutes: 12

This ExamTray Free Online Exam/Quiz/Trivia tests your Java Programming Skills on Java Relational Operators or Conditional Operators. Equality, Greater than and Less than are tested. 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 Relational Operators before attempting this test.

All the Best

1) What is the other name for Relational Operators in Java?
2) How many minimum number of operands are required to use Comparison operators in Java?
3) What are the types of data that can be used along with Relational operators in Java?
4) Choose the Conditional operators of Java listed below.
5) Which operator group has higher priority between (>, >=, <, <=) and (==, !=)?
6) What is the output of the Java code snippet?
int k=20;
if(k)
{
  System.out.println("YES");
}
else
{
  System.out.println("NO");
}
7) What is the output of Java code snippet?
int[] ary = {5,6,7,8};
if(ary.length > 2)
{
  System.out.println(ary[2]);
}
8) What is the data type of output of any Comparison Operation in Java?
9) What is the output of the Java code snippet?
char ch='A';
if(ch > 70)
{
  System.out.println("PIZZA");
}
else
{
  System.out.println("BURGER");
}
10) What is the output of Java code snippet?
int a=5, b=10;
if(++b>10||a++=5)
{
  System.out.println("PIZZA="+a);
}
else
{
  System.out.println("BURGER="+a);
}
11) Among Relational operators and Assignment operators, which operators have higher priority?
12) What is the output of the Java code snippet?
int a=20, b=10;
boolean c = a>=10 & b<20;
System.out.println(c);