Mega Code Archive

 
Categories / Java / Data Type
 

Convert string to integer

class Main {   public static void main(String[] args) {     int x, y;     x = Integer.parseInt("1");     y = Integer.parseInt("2");     if (x > y) {       System.out.println(x + ">" + y);     } else if (x < y) {       System.out.println(x + "<" + y);     } else {       System.out.println(x + "=" + y);     }   } }