Given the following method and definition and assuming that Str array is correctly initialized and filled elsewhere :
1.
String [] Str ;
2. public int findstring(String find) {
3. for ( int i = 0; i < Str.length ; i++){
4. if ( find.equalsIgnoreCase( Str[i] )) return i ;
5. }
6. System.out.println("Last String Examined : " + Str[i-1]);
7. return -1;
8. }
What will happen when we compile this code and use this method to look up a String which does not occur in Str array ?
a. NullPointerException will be generated at line 6.
b. The compiler will object to line 6.
c. The last String in the array will be written to standard output by line 6.
d. "Last String Examined : null" will be written to standard output by line 6.
The correct answer given is b...........HOW..........???
Please explain the answer.