Give the output of the following method: public static void main (String [] args) { int a = 5; a++; System.out.println(a); a -= (a--) − (--a); System.out.println(a); }
Advertisements
Question
Give the output of the following method:
public static void main (String [] args)
{
int a = 5;
a++;
System.out.println(a);
a -= (a--) − (--a);
System.out.println(a);
}
One Line Answer
Advertisements
Solution
The output of this method is 6 and 4.
shaalaa.com
Is there an error in this question or solution?
