By | August 1, 2015

Java Interview Questions and Answers – Compare String in Different way

Method 1

new String("test").equals("test")

Method 2

"test" == "test"

Method 3

"test" == "te" + "st"

Method 4

"test" == "!test".substring(1).intern()

 

Share this knowledge ! Join us on Facebook ! Now Whatsapp sharing is supportable ! TooDey Inc.

Leave a Reply

Your email address will not be published. Required fields are marked *