Question: 8. Assume that the String variables str1 and str2 have been properly declared and initialized. Which of the following conditions correctly tests whether the value

 8. Assume that the String variables str1 and str2 have been

8. Assume that the String variables str1 and str2 have been properly declared and initialized. Which of the following conditions correctly tests whether the value of str1 is greater than or equal to the value of str2 (in lexicographical order)? A. str1>=str2 B. str1. CompareTo ( str 2)>=0 C. str1. compareTo ( stre 2)== true D. str1.length ()> str2.length () 1 str1 >= str2 E. str1.equals ( str2) 1 str1. compareTo ( str2) ==1

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 Databases Questions!