Java Arithmetic Operator Question 8

Question

What is the output of the following code?

public class Main {
  public static void main(String[] args) {

    double x = 1.0; 
    double y = 5.0; 
    double z = x-- + (++y); 
    System.out.println("x:" + x);
    System.out.println("y:" + y);
    System.out.println("z:" + z);

  }//from  w  w w .  ja  v  a  2  s  .  com
}


x:0.0
y:6.0
z:7.0



PreviousNext

Related