Search:

Type: Posts; User: macko

Search: Search took 0.42 seconds.

  1. Replies
    31
    Views
    2,890

    Re: string==null or string.equals(null) problem

    Say you declare a string

    public String str = "";

    it will not return as null during the program..

    you're simply searching for a blank string.

    Its only if you were to declare it at the...
  2. Replies
    31
    Views
    2,890

    Re: string==null or string.equals(null) problem

    Glad you figured it out, Due to giving answers out I'm not allowed to post code :(

    But congratulations on figuring it out.
  3. Replies
    31
    Views
    2,890

    Re: string==null or string.equals(null) problem

    ahh thought i was doin something wrong :O... though i guess you would've told me if i had been xD
  4. Replies
    31
    Views
    2,890

    Re: string==null or string.equals(null) problem

    Kevin why have my other 2 posts been deleted :O.. is there a rule on the contents of them?
  5. Replies
    31
    Views
    2,890

    Re: string==null or string.equals(null) problem

    Well, Anything can be simplified... If your doing the same thing in a loop more then 4 times you should be able to narrow it down, as for the null of a string..



    if(string.equals("")){

    }
  6. Replies
    31
    Views
    2,890

    Re: string==null or string.equals(null) problem

    i feel ya pain brah :|
  7. Replies
    31
    Views
    2,890

    Re: string==null or string.equals(null) problem

    ideas you say eh?

    I'd try a java book :P
  8. Replies
    31
    Views
    2,890

    Re: string==null or string.equals(null) problem

    true heh, Well lets stick to the empty string then :-)

    Also I'm getting confused whilst helping people with programming, I cannot understand half of what they mean lol.. no console error shown...
  9. Replies
    31
    Views
    2,890

    Re: string==null or string.equals(null) problem

    If it is null it should generate the if statement as true am i correct?

    Although isn't that what he wanted.. if the string is null then execute an if statement
  10. Replies
    31
    Views
    2,890

    Re: string==null or string.equals(null) problem

    tbh if ur that desperate use both lmao..



    if (str4.equals(null) || str4.equals("")){
    // CODE HERE
    }


    only difference is.. str4 has been initialized on the 2nd statement.. the first...
Results 1 to 10 of 10