Wednesday, 23 November 2016

Which line will throw compile time error? 8 or 9?

 Which line will throw compile time error? 8 or 9?


  1. package com.instanceofjava;
  2. class A
  3. {
  4.     
  5. public static void main(String [] args)
  6. {
  7.  
  8.   Integer i = new Integer(null);
  9.   String s = new String(null);
  10.  
  11.  }
  12.  
  13. }

 

  1. Compile time Error at line number 9:The constructor String(String) is ambiguous

No comments:

Post a Comment