Results 1 to 2 of 2
  1. #1
    hmcoder is offline Member
    Join Date
    Jan 2011
    Posts
    1
    Rep Power
    0

    Default cannot compare string

    how tos compare two string for seeing if equal
    i am using string1 == string2 but not giving expected result.

    thanks

  2. #2
    user0 is offline Senior Member
    Join Date
    Dec 2010
    Posts
    100
    Rep Power
    0

    Default

    Hi - when comparing two strings, please use .equals() method. For example:
    if(String1.equals(String2));

    Best,
    --user0--

Similar Threads

  1. Replies: 8
    Last Post: 02-22-2014, 09:06 AM
  2. How compare two String?
    By artemff in forum New To Java
    Replies: 8
    Last Post: 08-29-2011, 09:00 AM
  3. Why we use String compare to String Buffer
    By Sharath_Forums in forum New To Java
    Replies: 1
    Last Post: 12-06-2010, 07:21 AM
  4. compare sql resultset with a String
    By cotarelo in forum Networking
    Replies: 6
    Last Post: 06-21-2010, 04:53 PM
  5. String Compare not working
    By Revelation in forum New To Java
    Replies: 3
    Last Post: 06-30-2007, 07:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •