View RSS Feed

Recent Blogs Posts

  1. Java String comparison with the equals method

    by , 04-26-2012 at 07:00 PM
    About 95% of time, I prefer comparing strings by using Java String class’ equal methods. It is shown below:
    Java Code:
    if (string1.equals(string2))
    String equal method observes if exactly similar string of characters are present in Java strings, they would be considered as equal.
    Quick String comparison could be observed, with equal method, 2 strings wouldn’t be equal as same characters are not present.
    Java Code:
    String string1 = "foo";
    String string2
    ...
    Categories
    Compare