CJCoding With Joseph
← Back to Question List
Java Code Walkthrough #47

Char Plus Int Promotion

easyCasting

📄 Code

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

🎯 Your Answer