Question: Assume the following code is in a proper class and main method. What would print? int num1 = 10; int num2; num2 = num1++-2;

Assume the following code is in a proper class and main method. 


Assume the following code is in a proper class and main method. What would print? int num1 = 10; int num2; num2 = num1++-2; System.out.println(num2);

Step by Step Solution

3.51 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Explanation Heres a breakdown of what happens 1 int num1 10 This line declares ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!