Java Arithmetic Operator Question 10

Question

What is the output of the following code?

public class Main {
  public static void main(String[] args) {
    double x = 10;
    x + = 2; // Statement 
    System.out.println(x += 2); // Expression 
  }
}


Compile time error

Note

There are no spaces in the augmented assignment operators.

For example, + = should be +=.




PreviousNext

Related