Sail E0 Webinar
Question


What is the output of this 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);
}
}
Options:
A .  3 2 4
B .  3 2 3
C .  2 3 4
D .  3 4 4
Answer: Option D

None.
output:
$ javac Output.java
$ java Output
3 4 4




Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers