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());

}

}

  1. Name the exception thrown from the above code?
  2. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!