Search:

Type: Posts; User: newbie

Search: Search took 0.06 seconds.

  1. Re: What is wrong in My code. Going to Else part..Can you please suggest me.

    Somewhere inside your MAIN method, you need to say TestType = something, as the code you've shown us means its null.
  2. Re: What is wrong in My code. Going to Else part..Can you please suggest me.

    Comparing two Objects which have been assigned String values work fine. The problem is reading your code.


    public static void main(String[] args) {
    TestType.toString();
    ...
  3. Re: What is wrong in My code. Going to Else part..Can you please suggest me.

    Until you show us the exact values both variables hold before you do the equality test, we cannot help you.
  4. Re: What is wrong in My code. Going to Else part..Can you please suggest me.

    It is going into the else clause because your TestType object is not the same as name1. This is expected behaviour.
Results 1 to 4 of 4