What is the output of the following code?
public class StringExample{
public static void main(String []args){
String s="New";
String s1=s;
String s2="D";
String s3="New";
System.out.println(s==s1);
System.out.println(s3==s2);
System.out.println(s3==s1);
System.out.println(s1.equals(s1));
System.out.println(s3.equals(s2));
System.out.println(s3.equals(s1));
}
}
Ans :
true
false
true
true
false
true
5 Comments:
Any other blogs on this subject?
Ray at time share resale
Hi Ashish. I don't normally bother with comments but feel a little bored today and am trying to waste a little time. I was just surfing around the net (actually looking for info on Time Share Resale) when I came across your blog. Just wanted to let you that I've gone back and read through some of your past posts. They caught my interest and I can relate to a quite a bit of what you say. So keep it up - I guess.
Hi Ashish. I don't normally bother with comments but feel a little bored today and am trying to waste a little time. I was just surfing around the net (actually looking for info on Time Share Resale) when I came across your blog. Just wanted to let you that I've gone back and read through some of your past posts. They caught my interest and I can relate to a quite a bit of what you say. So keep it up - I guess.
Hi Ashish. Hope you are well. I came across your site totally by accident. In fact it wasn't exactly on a topic I was looking for (I was on the lookout for Sell Time Share info). But as I was searching, one link led me to another and I got curious about your blog. I found it interesting and thought I'd drop you a line to tell you so. I guess thats what surfing is all about.
Hi Ashish. I don't normally bother with comments but feel a little bored today and am trying to waste a little time. I was just surfing around the net (actually looking for info on Sell Time Share) when I came across your blog. Just wanted to let you that I've gone back and read through some of your past posts. They caught my interest and I can relate to a quite a bit of what you say. So keep it up - I guess.
Post a Comment
<< Home