string null check in java
If we want to check weather string is empty or not then use the
String str ="null";
if(str != null && !str.isEmpty())
{
sysout("null");
}
else{
sysout("not null");
}
If we want to check weather string is empty or not then use the
String str ="null";
if(str != null && !str.isEmpty())
{
sysout("null");
}
else{
sysout("not null");
}
No comments:
Post a Comment