What will be the output of the following Java program?class Output {public static void main(String args[]) { int a = 1; int b = 2; int c; int d; c = ++b; d = a++; c++; b++; ++a; System.out.println(a + " " + b + " " + c);} }

🎲 Try a Random Question  |  Total Questions in Quiz: 39  |  🧠 Study this quiz with Flashcards
This question is part of a full practice quiz:
Java Basics Practice Test: Operators — practice the complete quiz, review flashcards, or try a random question.

Here are the different types of operators in Java: Arithmetic operators: are used to perform mathematical operations on numeric values. Assignment operators: are used to assign values to variables. Relational operators: are used to compare two values and return a boolean result. Logical operators: are used to combine two or more boolean expressions and return a single boolean result. Bitwise operators: are used to perform bitwise operations on integer values. Conditional operators: are used to evaluate a condition and return one of two values based on the result of the... Show more

What will be the output of the following Java program?<br>class Output <br>{<br>public static void main(String args[]) <br>{ <br> int a = 1;<br> int b = 2;<br> int c;<br> int d;<br> c = ++b;<br> d = a++;<br> c++;<br> b++;<br> ++a;<br> System.out.println(a + " " + b + " " + c);<br>} <br>}