java integer compareto
public class IntegerCompareToExample {
public static void main(String[] args) {
// compares two Integer values numerically
Integer x = new Integer("90");
Integer y= new Integer("58");
int retResult = x.compareTo(y);
if(retResult > 0) {
System.out.println("x is greater than y");
} else if(retResult< 0) {
System.out.println("x is less than y");
} else {
System.out.println("x is equal to y");
}
}
}
Also in Java:
- java shuffle list
- how to use for loop for array in java
- java string contains at beginning
- android java retrofit offline cache
- working with buttons in applet java
- split method in java
- check java version cmd
- set color of text for jlabel
- shortcut to find a class in java project eclipse
- pascals triangle java
- java hashmap size
- create notification android
- java declare an int inside an if statement
- java initialize float to zero
- how to print in java
- java rest client response json
- java map foreach
- Create ArrayList from array java
- int java
- java put a char array into a string
- java convert string with commas to long
- string reverse in java
- check if a string is a substring of another string java
- java 8 list stream delete by name