Guest User

Untitled

a guest
Oct 18th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. static public void main(String args[])
  2. {
  3. String a = "Can", b = "Am", c = "Be", d= " ";
  4. int first = a.compareTo(b);
  5. int second = a.compareTo(c);
  6. int third = b.compareTo(c);
  7. int fourth = d.compareTo(d);
  8. if (first > 0)
  9. {
  10. fourth = second;
  11. second = first;
  12. first = fourth;
  13.  
  14. }
  15.  
  16. System.out.println(first);
  17. System.out.println(second);
  18. System.out.println(third);
  19. System.out.println(fourth);
  20.  
  21.  
  22. }
Add Comment
Please, Sign In to add comment