This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args){ | |
String s1= "abc"; | |
String s2= new String("abc"); | |
String s3 = "abc"; | |
System.out.println(s1==s2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main(arg:Array<String>){ | |
val s1 = "abc" | |
val s2 = StringBuilder("abc").toString() | |
val s3 = "abc" | |
println(s1 === s2) | |
println(s1 == s2) |