Q. With x = 0, which of the following are legal lines of Java code for changing the value of x to 1?
1. x++;
2. x = x + 1;
3. x += 1;
4. x =+ 1;

  • (A) 1, 2 & 3
  • (B) 1 & 4
  • (C) 1, 2, 3 & 4
  • (D) 3 & 2
πŸ’¬ Discuss
βœ… Correct Answer: (C) 1, 2, 3 & 4

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
104
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Pooja
Publisher
πŸ“ˆ
96%
Success Rate