Top Posters
Since Sunday
1
1
New Topic  
lurielbank lurielbank
wrote...
Posts: 472
Rep: 9 0
4 years ago
What is y displayed in the following code?

public class Test {
public static void main(String[] args) {
int x = 1;
int y = x++ + x;
System.out.println("y is " + y);
}
}


▸ y is 1.

▸ y is 2.

▸ y is 3.

▸ y is 4.
Textbook 
Introduction to Java Programming, Comprehensive Version

Introduction to Java Programming, Comprehensive Version


Edition: 10th
Author:
Read 95 times
1 Reply
Replies
Answer verified by a subject expert
OmamaOmama
wrote...
Posts: 343
4 years ago
Sign in or Sign up in seconds to unlock everything for free
More solutions for this book are available here

Related Topics

lurielbank Author
wrote...

4 years ago
I appreciate what you did here, answered it right Smiling Face with Open Mouth
wrote...

Yesterday
This helped my grade so much Perfect
wrote...

2 hours ago
Smart ... Thanks!
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  929 People Browsing
Related Images
  
 305
  
 291
  
 363
Your Opinion
How often do you eat-out per week?
Votes: 80