Top Posters
Since Sunday
1
1
l
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 96 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
Helped a lot
wrote...

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

2 hours ago
this is exactly what I needed
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  831 People Browsing
Related Images
  
 4903
  
 47
  
 292
Your Opinion
Who will win the 2024 president election?
Votes: 8
Closes: November 4

Previous poll results: How often do you eat-out per week?