Java Compare 2 integers with equals or ==?
问题 i am very very new to Java and i would like to know how can i compare 2 integers? I know == gets the job done.. but what about equals? Can this compare 2 integers? (when i say integers i mean "int" not "Integer"). My code is: import java.lang.*; import java.util.Scanner; //i read 2 integers the first_int and second_int //Code above if(first_int.equals(second_int)){ //do smth } //Other Code but for some reason this does not work.. i mean the Netbeans gives me an error: "int cannot be