Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class StringEqualityTest {
- public static void main(String args[]) {
- String s1 = "abc";
- String s2 = "abc";
- String s3 = new String("abc");
- String s4 = new String("abc");
- System.out.println(s1==s2);
- System.out.println(s3==s4);
- System.out.println(s1.equals(s2));
- System.out.println(s1.equals(s3));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement