Java String isEmpty Example
String class isEmpty method example
String class isEmpty method example. This example shows you how to use isEmpty method.This method Returns true if, and only if, length() is 0.
Here is the code:-
/**
* @(#) IsEmptystring.java
*Program that Returns true if, and only if, length() is 0
* @Version 01-May-2008
* @author Rose India Team
*/
public class IsEmptystring
{
public static void main(String[] args)
{
String str1 = "RoseIndia is my Team.";
// Returns true if, and only if, length() is 0
boolean s1 = str1.isEmpty();
System.out.println( str1 + "IS EMPTY :- " + s1);
}
} |
null
|