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



Comment Added by : vijay

Comment Added at : 2011-08-21 15:09:41

Comment on Tutorial : equals( ) Versus == in Java By Mashoud
what ll be result for s1==s2 and s1.equals(s2) for following cases?
1)String s1="hello";
String s2="hello";

2)String s1 = new String("Hello");
String s2 = new String("Hello");

3)String s1="hello";
string s2=s1;


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. everyone should appreciate this
View Tutorial          By: Udara at 2010-10-18 01:15:09

2. mohd see this link http://www.java-samples.com/sho
View Tutorial          By: Issac at 2011-05-31 02:39:55

3. example required
View Tutorial          By: revathy at 2009-09-03 01:53:04

4. I am able to iterate the list.Now i want to print
View Tutorial          By: akanksha at 2012-09-26 05:25:12

5. /* File name : Employee.java */
public abst

View Tutorial          By: Anonymous at 2012-11-16 12:23:17

6. good one
View Tutorial          By: saurabh at 2012-01-17 04:43:29

7. Nice one , Compailed no Errors ... but when execut
View Tutorial          By: Diamant at 2012-12-04 00:17:11

8. Please don't use DataInputStream to read text. Unf
View Tutorial          By: Peter Lawrey at 2013-01-30 23:46:47

9. You can not overload the private method in Test cl
View Tutorial          By: Gaurav at 2013-07-28 15:53:20

10. i have written above code but the values are not s
View Tutorial          By: varun at 2010-01-15 18:37:19