2. What is the result of attempting to compile and run the program? class Question2 { static byte a; static short b; sta
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
2. What is the result of attempting to compile and run the program? class Question2 { static byte a; static short b; sta
compiler.
And give the explanation for each output.
2. What is the result of attempting to compile and run the program? class Question2 { static byte a; static short b; static char c; static int d; static long e; static String s; public static void main(String[] args) { System.out.println(a+b+c+d+e+s); } } Coding (from compiler): Output (from compiler): Explanation: (5 marks)