Version Comparison
A release manager verifies if a version string matches the current target and evaluates its alphabetical ranking.
What is printed when the following Java program is compiled and run?
public class QuestionTrace {
public static void main(String[] args) {
String a = "BETA";
String b = "ALPHA";
int val = a.compareTo(b);
boolean same = a.equals("BETA");
System.out.println(val > 0 && same);
}
}
A
false
B
true
C
0
D
1
Question Leaderboard
Not enough data yet to show leaderboard.
