adplus-dvertising

Welcome to the Operators and Control Statements MCQs Page

Dive deep into the fascinating world of Operators and Control Statements with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Operators and Control Statements, a crucial aspect of Java Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Operators and Control Statements, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within Java Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Operators and Control Statements. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of Java Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Operators and Control Statements. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Operators and Control Statements MCQs | Page 13 of 38

Explore more Topics under Java Programming

Discuss
Answer: (d).true and false are non numeric values
Q122.
What is the output of this program?
class Relational_operator
{
 public static void main(String args[])
 {
  int var1 = 5;
  int var2 = 6;
  System.out.print(var1 > var2);
 }
}
Discuss
Answer: (d).FALSE
Q123.
What is the output of this program?
class ternary_operator
{
 public static void main(String args[])
 {
  int x = 3;
  int y = ~ x;
  int z;
  z = x > y ? x : y;
  System.out.print(z);
 }
}

a.

0

b.

1

c.

3

d.

-4

Discuss
Answer: (c).3
Q124.
What is the output of this program?
class Output
{
 public static void main(String args[])
 {
  int x , y = 1;
  x = 10;
  if (x != 10 && x / 0 == 0)
   System.out.println(y);
  else
   System.out.println(++y);
 }
}
Discuss
Answer: (b).2
Q125.
What is the output of this program?
class Output
{
 public static void main(String args[])
 {
  boolean a = true;
  boolean b = false;
  boolean c = a ^ b;
  System.out.println(!c);
 }
}
Discuss
Answer: (c).FALSE
Q126.
What should be expression1 evaluate to in using ternary operator as in this line?
 expression1 ?   expression2  :  expression3
Discuss
Answer: (c).Boolean
Q127.
What is the value stored in x in following lines of code?
int x, y, z;
x = 0;
y = 1;
x = y = z = 8;

a.

0

b.

1

c.

9

d.

8

Discuss
Answer: (d).8
Q128.
What is the order of precedence (highest to lowest) of following operators?

1. &
2. ^
3. ?:
Discuss
Answer: (a).1 -> 2 -> 3
Q129.
What is the output of this program?
class operators
{
 public static void main(String args[])
 {
  int var1 = 5;
  int var2 = 6;
  int var3;
  var3 = ++ var2 * var1 / var2 + var2;
  System.out.print(var3);
 }
}
Discuss
Answer: (c).12
Q130.
What is the output of this program?
class Main
{
public static void main(String args[])
 {
  int x = 8;
  System.out.println(++x * 3 + " " + x);
 }
}
Discuss
Answer: (d).27 9

Suggested Topics

Are you eager to expand your knowledge beyond Java Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!