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 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
Get step-by-step solutions from verified subject matter experts
