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. Please provide me a particular flow of validations
View Tutorial          By: Deepali at 2013-05-10 10:38:18

2. Hello
I installed Android in eclipse...only

View Tutorial          By: amit kumar at 2012-01-19 11:04:55

3. gooooooodddddddd
View Tutorial          By: arya tandon at 2015-02-23 09:08:05

4. which Iden WebJal do i need to load up my music MI
View Tutorial          By: phil at 2007-10-18 17:51:19

5. Simply explained theory.......
Thanx......!

View Tutorial          By: Priya at 2013-03-03 14:42:05

6. Hi, my name is Jaime,
I wan't to do a jsp w

View Tutorial          By: Jaime at 2011-10-24 12:47:50

7. how can i use <img> tag in message body?

View Tutorial          By: Sonal at 2012-11-07 07:05:33

8. need to be explained more
View Tutorial          By: parul at 2011-06-30 08:34:29

9. Nice Intro .......
View Tutorial          By: MohanRaja at 2012-06-28 11:02:40

10. gudeveniing!! plz gave me some project title gor j
View Tutorial          By: ivie at 2012-12-12 11:00:43