String.isEmpty() Checks if the string is empty or not.
Return value is boolean ( true or false )

Here are some examples with output.
String str1 = "";  
String str2 = "plus2net"; 

System.out.println(str1.isEmpty()); // true
System.out.println(str2.isEmpty()); // false

Checking a null string

It returns exception.
String str3=null;
Exception in thread "main" java.lang.NullPointerException

All String functions

Post your comments , suggestion , error , requirements etc here

We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2021 All rights reserved worldwide Privacy Policy Disclaimer