i am learning scala as i have experience in java but i have following doubts in scala.
java
String str1 = "Hello"
String str2 = "Hello"
java allocate same memory for the string and have two reference as str1 and str2. when we compare str1==str2 we will get true as java would compare reference.
my question is how scala would allocate memory for same string as given above? what is the way to compare the value of String and its reference?
i am getting confuse while learning object comparison in scala?
can somebody explain me with examples for String memory allocation and comparison of String and objects?