What gets printed when the following program is compiled and run. protected class example {public static void main(String args[]) {String test = "abc";test = test + test;System.out.println(test);}}

  1. The program does not compile because statement "test = test + test" is illegal.

  2. The program prints "abc"

  3. The program prints "abcabc"

  4. The class does not compile because the top level class cannot be protected.


Correct Option: D

Find more quizzes: