Thursday, March 12, 2015

Java String is Empty in java pgm



Java String isEmpty

public class JavaStringIsEmptyExample
{
public static void main(String args[])
{
String str1 = "";
String str2 = null;
String str3 = "Hello World";
System.out.println("Is String 1 empty? :" + str1.isEmpty()); System.out.println("Is String 3 empty? :" + str3.isEmpty());
   }
}

No comments:

Post a Comment