Answers for "java using equals and OR (||) operator together"

2

Difference between == operator and equals method in java

// == operator
String str1 = new String("Hello");
String str2 = new String("Hello");
System.out.println(str1 == str2); // output : false


// equals method
String str1 = new String("Hello");
String str2 = new String("Hello");
System.out.println(str1.equals(str2)); // output : true
Posted by: Guest on November-02-2020

Code answers related to "java using equals and OR (||) operator together"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language