What will the following program print when run?.
public class Main { public static void main (String[] args) { String cs1 = "JAVA"; StringBuilder cs2 = new StringBuilder(cs1); System.out.println(cs1.compareTo(cs2) == cs2.compareTo(cs1)); } }
Select the one correct answer.
(c)
The classes String and StringBuilder are unrelated, therefore the first call to the compareTo()
method will not compile.
The class StringBuilder does not implement the Comparable interface, therefore the second call to the compareTo()
method will not compile.