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. SMSC number is the sms center no. put the sim to a
View Tutorial          By: Java MAn at 2012-01-28 19:08:23

2. hai, i tried the abvoe code, m getting the follwin
View Tutorial          By: charan at 2011-10-20 12:59:59

3. Hi Kartikeyan and all,

can you plea

View Tutorial          By: Piyush at 2008-11-14 07:24:16

4. haii , i am fully happy by searching all component
View Tutorial          By: AJEET KUMAR DALEI at 2011-04-23 21:20:00

5. It tried this app... It's working fine... really a
View Tutorial          By: Prakash at 2012-01-04 06:33:12

6. Thanks.It is very helpful
View Tutorial          By: JENI at 2013-03-23 11:01:58

7. Hi I too need the full program for understanding
View Tutorial          By: Sumanth at 2010-10-03 16:02:46

8. thanx. for this tutorial. i was having some doubt
View Tutorial          By: prabhash at 2011-09-06 10:15:19

9. Hi!
Any body have code for recieving sms fr

View Tutorial          By: Haseeb at 2009-07-01 04:59:13

10. thanks
for your clear and precise explanati

View Tutorial          By: Tausiq at 2009-09-05 07:27:49