Given below the sample code :
class base{
public static void main(String[] argv) {
try {
argv = null;
argv[0] = "Check";
System.out.println(argv[0]);
} catch (Exception ex) {
System.out.println("General Exception");
} catch (NullPointerException npe) {
System.out.println("NullPointerException");
}}}
What will be the output of the above code ?
1. Compilation error
2. General Exception
3. NullPointerException
4. General Exception(1)
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.