Will the text located into conditional operator block be printed out?

public static void main(String[] args){
       int x = 18;
       int y = x++;
       if (x == 18 && y > 10){
              System.out.println("y = " + y);
              System.out.println("x = " + x);
       }
}
Explanation
After y is initialised with the value of x (18), x will be incremented by 1 and will be equal to 19.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes