Answers for "compareto and compare and equal in java"

C
4

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
Posted by: Guest on November-30-2021
0

string compareto vs equals java

compareTo() when you need to know the difference in length between strings 
that start with the same sequence of characters.
  
  System.out.println("sumit".compareTo("timus"));//-1
Posted by: Guest on August-25-2021

Code answers related to "C"

Browse Popular Code Answers by Language