Question

2.1 Assume that the variable myFriends is an array of String objects that has been declared and

initialized. How would you write a Java code fragment to check if the second entry in the array matches

the name Jean (the name would be written as a String literal in Java "Jean").

Write your answer here:

2.2 Assume that the variable myFriends is an array of String objects that has been declared and

initialized (same as in the above question). Explain in words what the following code will do when it

executes.

System.out.println (myFriends [myFriends.length]);

Write your answer here: