I want to know why we cant use <, <=, >,>= relational operators on String literals.
import java.util.*;
public class Coffee{
public static void main(String args[]){
String s1="Cat";
String s2="Dog";
System.out.println(s1<s2);
}
}
gets an error " operator < cannot be applied to java.lang.String" why?
can't it compare like this C < D so true???
Can anyone explain why?? Thanks in advance.. :)