Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to compare int and String in java
How to compare int and String in java
Convert int into String, and then compare it through equals.

1, define an int and a String.

int? Answer? =? 1; //Define an integer.

int? str? =? "232"; //Define a string. 2. convert int into string.

String? Stella? =? a+" "; //By connecting with the string, it is converted into the string stra3 and compared with equals.

Bull? b? =? stra . equals(str); //Compare whether they are consistent. Returns true if they are equal, otherwise, b is false.