Answers for "a.compareto(b) in java"

8

compareto in java string

******Java String compareTo()******

  The Java String class compareTo() method compares the given 
  string with the current string lexicographically. 
  It returns a positive number, negative number, or 0.
  ___________________________________________
  	if s1 > s2, it returns positive number  
	if s1 < s2, it returns negative number  
	if s1 == s2, it returns 0  
  ___________________________________________
Posted by: Guest on August-06-2021
11

compareto method java

public int compareTo(Jedi jedi){
    return this.age > jedi.age ? 1 : this.age < jedi.age ? -1 : 0;
}
Posted by: Guest on November-25-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language