import java.util.*;
import java.lang.*;
import java.io.*;
// The main method must be in a class named "Main".
class Main {
public static void main(String[] args) {
//compare variable
String str1="Curious";
String str2="curious";
if(str1==str2){ //location is compared using ==
}
else{
System.out.println("not equals");
}
//compare values in objects
String str3 =new String("Curious");
String str4 =new String("Curious");
if(str3.equals(str4)){
System.out.println("Equals");
}
else{
System.out.println("not equals");
}
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: