Comment on Tutorial - equals( ) Versus == in Java By Mashoud



Comment Added by : ku

Comment Added at : 2009-05-11 10:17:51

Comment on Tutorial : equals( ) Versus == in Java By Mashoud
When JVM find two string object with de same content, in order to save memory, insted of create two objects, this two objects stay referenced to the same memory location.
I mean, if you have a string "Hello" already created, when you create a new string with the same word "Hello" JVM detect that already exist this string and then did not create a new object, JVM just make a reference the two objects to the same "Hello", so S1 and S2 are "pointing" to the same place in the memory, and S1 == S2 are true


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. i didnot get the answer
View Tutorial          By: ramana at 2013-02-04 06:36:37

2. The program will work only need to change

View Tutorial          By: LEENA NARULA at 2012-06-15 06:45:06

3. Hi, from where i can download javax.comm API jar f
View Tutorial          By: Chandra at 2008-11-19 11:49:46

4. What is the difference between:
CMUsphinx4-

View Tutorial          By: Netrika at 2011-11-26 19:55:07

5. import java.util.*;

class Pstring<

View Tutorial          By: Bhaskar.pg at 2014-05-29 12:39:52

6. its easy to understand the complete history of jav
View Tutorial          By: Arun Tony at 2011-04-10 07:12:04

7. Hi, You can use a javascript array. Which means wh
View Tutorial          By: Mashoud at 2008-05-04 02:54:38

8. can we use if statment with swich,,,!!!
View Tutorial          By: dena at 2011-07-09 13:52:27

9. thank you sir
View Tutorial          By: sivaranjani at 2015-01-30 01:15:40

10. Thanks for everything... I'm greeting you from Aze
View Tutorial          By: Shahriyar at 2011-04-28 15:54:14