equal 2 « Development « Java Data Type Q&A





1. Using equals() to compare strings    forums.oracle.com

2. String equals and == .... difference    forums.oracle.com

System.out.println("equals: " + (java1.equals(java2))); System.out.println("==: " + (java1 == java2)); } } For the above code I get output as "true" for the first and "false" for the second expression. output of equals is fair enough but for "==" operator its giving false which as per my thinking should be true as the funda of String pooling says NO TWO STRINGS ...