Question: If String myFriend = new String(Ginny);, which of the following has the value 1? a. myFriend.compareTo(Gabby); b. myFriend.compareTo(Gabriella); c. myFriend.compareTo(Ghazala); d. myFriend.compareTo(Hammie);

If String myFriend = new String("Ginny");, which of the following has the value 1?
a. myFriend.compareTo("Gabby");
b. myFriend.compareTo("Gabriella");
c. myFriend.compareTo("Ghazala");
d. myFriend.compareTo("Hammie");

Step by Step Solution

3.34 Rating (160 Votes )

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 Java Programming Questions!