Multiple choice

What will be the output of the given program? class MyClass { public static void main(String AR[]) { short a = 36768; System.out.println(a); } }

  1. Run time error

  2. Successful execution

  3. Compile time error

  4. None of these

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Range of short variable is between -32,768 to 32,767. So, java compiler gives compile time error.