JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
public class Main {
public static void main(String[] args) throws Exception {
String s1 = new String("wow");
String s2 = "wow";
System.out.println(s1.getClass().getSimpleName()); //returns "String"
System.out.println(s2.getClass().getSimpleName()); //returns "String"
System.out.println(s1 == s2); //returns "false"
String s3 = "wow";
String s4 = "wow";
System.out.println(s1.getClass().getSimpleName()); //returns "String"
System.out.println(s2.getClass().getSimpleName()); //returns "String"
System.out.println(s3 == s4); //returns "true"
}
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run