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



Related Tutorials

Java program to get location meta data from an image

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

Archived Comments

1. can I ask question? how to make a complete program
View Tutorial          By: manuel at 2012-08-13 10:06:24

2. nice tutorial man !
View Tutorial          By: yash at 2012-11-10 05:08:31

3. I made this "In your AndroidManifest.xml file
View Tutorial          By: lalo at 2011-11-20 05:56:43

4. @Brian You surely can deploy your server code clas
View Tutorial          By: Ayush at 2013-06-10 13:22:38

5. Artical is good but it is not clearly define that
View Tutorial          By: Rohit Saxena at 2010-09-02 04:00:11

6. Thank you for this useful script! It works very we
View Tutorial          By: Giuseppe at 2010-12-09 05:35:43

7. java.lang.IllegalArgumentException
at java

View Tutorial          By: gopal at 2011-03-21 00:45:51

8. Nice Article, but these concepts are pretty confus
View Tutorial          By: Goldest at 2011-03-18 01:50:50

9. Before i had lot of doubts in abstract class... no
View Tutorial          By: Mohandoss at 2012-04-02 05:08:43

10. sir i m getting chat server started bt how a clien
View Tutorial          By: ashu at 2010-11-02 08:13:00