Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

IsEmpty - Returns whether the given string is empty or not in Java

  1. public class IsEmpty {
  2. public static void main(String args[]){
  3. String str1 = "";
  4. String str2 = null;
  5. String str3 = "ForgetCode";
  6. System.out.println("Is String 1 empty? :" + str1.isEmpty());
  7. System.out.println("Is String 3 empty? :" + str3.isEmpty());
  8.  
  9. }
  10. }