¡@

Home 

java Programming Glossary: s1.equals

How do I make my string comparison case insensitive?

http://stackoverflow.com/questions/2220400/how-do-i-make-my-string-comparison-case-insensitive

to compare two strings String s1 Hello String s2 hello if s1.equals s2 System.out.println hai else System.out.println welcome It.. share improve this question The best would be using s1.equalsIgnoreCase s2 see javadoc You can also convert them both to upper..

What is the difference between “text” and new String(“text”) in Java?

http://stackoverflow.com/questions/3052442/what-is-the-difference-between-text-and-new-stringtext-in-java

foobar System.out.println s1 s2 false System.out.println s1.equals s2 true on two reference types is a reference identity comparison...

String comparison in Java

http://stackoverflow.com/questions/5286310/string-comparison-in-java

Java String variable setting - reference or value?

http://stackoverflow.com/questions/5835386/java-string-variable-setting-reference-or-value

s2 s1 s1 s1 c System.out.println s1 s2 on line 2 s1 s2 AND s1.equals s2 . After your concatenation on line 3 s1 now references a..

String equality vs equality of location

http://stackoverflow.com/questions/594604/string-equality-vs-equality-of-location

s3 new String BloodParrot is the man System.out.println s1.equals s2 System.out.println s1 s2 System.out.println s1 s3 System.out.println.. s1 s2 System.out.println s1 s3 System.out.println s1.equals s3 output true true false true Why don't all the strings have..

Comparing two strings with “==”: when will it work?

http://stackoverflow.com/questions/7479334/comparing-two-strings-with-when-will-it-work

instance of the string in the string constant pool. So s1.equals s3 will be true. And s1 s3 also is true since both the pointers.. area of memory than the string constant pool So while s1.equals s2 is true s1 s2 is false since they will be pointing to different..