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...
Type: Posts; User: macko
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...
Glad you figured it out, Due to giving answers out I'm not allowed to post code :(
But congratulations on figuring it out.
ahh thought i was doin something wrong :O... though i guess you would've told me if i had been xD
Kevin why have my other 2 posts been deleted :O.. is there a rule on the contents of them?
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("")){
}
i feel ya pain brah :|
ideas you say eh?
I'd try a java book :P
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...
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
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...