Single Choice
Moderate
QWhat will be the output of this code
class PostAndPre
{
public static void main( String args[])
{
int a = 2;
System.out.println(a++ - a++ +" Now a = "+a);
}
}
ID: #20254
Assignment Operators Java
110 views
Question Info
#20254Q ID
ModerateDifficulty
Assignment Operators JavaTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
Explanation
class PostAndPre { public static void main( String args[]) { int a = 2; System.out.println(a++ - a++ +" Now a = "+a); } }
-1 Now a = 4
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic