Question: public class Main { public static void main ( String args [ ] ) { String [ ] array = new String [ 2 ]

public class Main {public static void main(String args[]){String[] array = new String [2];String str;int i =1;try {for (i =1; i <3; i++)array [i]= new string("9");System.out.print(array[i-1]);}} catch (NullPointerException e){System.out.print("!");}}}whats the output?a.!b.9!c.9d. none of the above

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!