Aliensbrain
  • Home
  • Topics
  • Quizzes
  • Notebooks
  • Community
  • Sign in
  • programming languages Online Quiz - 179
  • package exceptions; public class TestException5 { static ...

package exceptions; public class TestException5 { static String trimString(String x) { return x.trim(); } public static void main(String[] args) { try { String s = trimString(null); System.out.println("s = "+s); } catch(Exception e) { System.out.println(" Exception "); } catch(NullPointerException ne) { System.out.println("Null Pointer Exception "); } } }

technology programming languages
  1. s = tcs Exception

  2. s = tcs Null Pointer Exception

  3. Exception

  4. Compiler Error


Show answer
Correct Option: D

Find more quizzes:

© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy