Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static public void main(String args[])
- {
- String a = "Can", b = "Am", c = "Be", d= " ";
- int first = a.compareTo(b);
- int second = a.compareTo(c);
- int third = b.compareTo(c);
- int fourth = d.compareTo(d);
- if (first > 0)
- {
- fourth = second;
- second = first;
- first = fourth;
- }
- System.out.println(first);
- System.out.println(second);
- System.out.println(third);
- System.out.println(fourth);
- }
Add Comment
Please, Sign In to add comment