+ 3

equals() methode

someone please explain what's equals() methode for ?

23rd Oct 2017, 9:14 AM
Haddada Zakaria
Haddada Zakaria - avatar
3 Antworten
+ 10
//Compares String value String str = "hello"; if(str.equals("hello"){System.out.println("hey");} //You can also use this method if you want to ignore case sensitive inputs. if(str.equalsIgnoreCase("HELLO"){System.out.println("Hey");}
23rd Oct 2017, 9:22 AM
D_Stark
D_Stark - avatar
1st Nov 2017, 2:30 PM
Said BAHAOUARY
Said BAHAOUARY - avatar
+ 4
Thank you David, pretty much clear
25th Oct 2017, 3:49 PM
Haddada Zakaria
Haddada Zakaria - avatar