Today Question is same on Strings only, We know that, if both - TopicsExpress



          

Today Question is same on Strings only, We know that, if both References pointing same object only, == operator returns true, else false. See this example & findout the Reason, based on the output & Share ur Views. ---------------------------------------------------------------------------------------- String s1 = java; String s2 = ja+va; String s3 = ja; String s4 = va; String s5 = s3 + s4; String s6 = s3 + va; String s7 = ja + s4; String s8 = ja.concat(va); String s9 = ja.concat(s4); String s10 = s3.concat(va); System.out.println(s1 == s2); // true System.out.println(s1 == s5); // false System.out.println(s1 == s6); // false System.out.println(s1 == s7); // false System.out.println(s1 == s8); // false System.out.println(s1 == s9); // false System.out.println(s1 == s10); // false ---------------------------------------------------------------------------------------- At the end well conclude about this Background things. For more info, Join here https://facebook/groups/sashi.kumar/
Posted on: Tue, 25 Mar 2014 20:09:17 +0000

Trending Topics



Recently Viewed Topics




© 2015