Question: public class Error02{ public static voidmain(Stringargs[]){ String s =null; System.out.println(Length of the string = +s.length()); } } Name the exception thrown from the above code?
public class Error02{
public static voidmain(Stringargs[]){
String s =null;
System.out.println("Length of the string = "+s.length());
}
}
- Name the exception thrown from the above code?
- Rewrite the code to manage the exception.
c.Does the code has Checked exception or Unchecked exception? Identify and explain in your own words.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
