how to compareTo in java
x.compareTo(y) < 0 // x < y
x.compareTo(y) <= 0 // x <= y
x.compareTo(y) != 0 // x != y
x.compareTo(y) == 0 // x == y
x.compareTo(y) > 0 // x > y
x.compareTo(y) >= 0 // x >= y
how to compareTo in java
x.compareTo(y) < 0 // x < y
x.compareTo(y) <= 0 // x <= y
x.compareTo(y) != 0 // x != y
x.compareTo(y) == 0 // x == y
x.compareTo(y) > 0 // x > y
x.compareTo(y) >= 0 // x >= y
java compareTo
String s1 = "2"
String s2 = "5"
s1.compareTo(s2); //returns difference between 2 Strings
3 //returns positive 3 since s2 string is higehr than s1 by 3
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us