CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

Pre Increment Inside Print

Java code walkthrough · Question 32
mediumOperators

Code

Read carefully. What does this print?
1public class Main {
2 public static void main(String[] args) {
3 int x = 3;
4 
5 System.out.println(++x);
6 System.out.println(x);
7 }
8}

Your answer