Related Examples
  1. String Array to Collection Example
  2. String Array Content Example
  3. String Declare Example
  4. String Array to ArrayList Example
  5. String Array Example
  6. Java String valueOf Example
  7. Java String trim Example
  8. Java String toUpperCase Example
  9. Java String toString Example
  10. Java String toLowerCase Example
  11. Java String toCharArray Example
  12. Java String substring Example
  13. Java String indexOf Example
  14. Java String startsWith Example
  15. Java String hashCode Example
  16. Java String matches Example
  17. Java String length Example
  18. Java String lastIndexOf Example
  19. Java String isEmpty Example
  20. Java String equalsIgnoreCase Example
  21. Java String equals Example
  22. Java String endsWith Example
  23. Java String copyValueOf Example
  24. Java String contentEquals Example
  25. Java String contains Example
  26. Java String concat Example
  27. Java String compareToIgnoreCase example
  28. Java String compareTo example
  29. Java String codePointCount Example
  30. Java String codePointBefore Example
  31. Java String codePointAt Example
  32. Java String charAt Example
  33. Java String valueOf(Object obj) Example
  34. Java String valueOf(long l) Example
  35. Java String valueOf(int i) Example
  36. Java String valueOf(float f) Example
  37. Java String valueOf(double d) Example
  38. Java String valueOf(char[] data, int offset, int count) Example
  39. Java String valueOf(char[] data)Example
  40. Java String valueOf(char c) Example
  41. Java String valueOf(boolean b)Example
  42. Java String trim Example
  43. Java String toUpperCase(Locale locale)Example
  44. Java String toUpperCase Example
  45. Java String toString Example
  46. Java String toLowerCase(Locale locale) Example
  47. Java String toLowerCase Example
  48. Java String toCharArray Example
  49. Java String substring(int beginIndex, int endIndex)Example
  50. Java String substring(int beginIndex)Example
  51. Java String subSequence(int beginIndex,int endIndex)Example
  52. Java String startsWith(String prefix,int toffset) Example
  53. Java String startsWith(String prefix)Example
  54. Java String split(String regex) Example
  55. Java String split(String regex)Example
  56. Java String replaceFirst Example
  57. Java replaceall CharAt Example
  58. Java String replace(char oldChar) Example
  59. Java String regionMatches(int toffset)Example
  60. Java String regionMatches(boolean ignoreCase)Example
  61. Java String matches Example
  62. Java String length Example
  63. Java String lastIndexOf(String str,int fromIndex)Example
  64. Java String lastIndexOf(String str)Example
  65. Java String lastIndexOf(int ch, int fromIndex) Example
  66. Java String lastIndexOf Example
  67. Java String isEmpty Example
  68. Java String intern Example
  69. Java String indexOf(String str,int fromIndex)Example
  70. Java String indexOf(String str) Example
  71. Java String indexOf(int ch, int fromIndex) Example
  72. Java String indexOf(int ch)Example
  73. Java String hashCode Example
  74. Java String getChars(int srcBegin) Example
  75. Java String getBytes(Charset charset) Example
  76. Java String getBytes Example
  77. Java String format(String format)Example
  78. Java String format(Locale l) Example
  79. Java String equalsIgnoreCase Example
  80. Java String equals Example
  81. Java String endsWith Example
  82. Java String copyValueOfchar[] Example
  83. Java String copyValueOf Example
  84. Java String contentEquals Example
  85. Java String contains Example
  86. Java String concat Example
  87. Java String compareToIgnoreCase Example
  88. Java String compareTo Example
  89. Java String codePointBefore Example
  90. Java String CodePointAt Example
  91. Java String CharAt Example
  92. Java String codePointAt Example
  93. Java String Class

View All Examples
 

Java String isEmpty Example

String class isEmpty method example


String class isEmpty method example:- This method returns boolean value true if and only if  .length methodreturns for the  object taken under process and returns false if object chosen is not empty that means it has .length()  method value greater than zero.

Syntax:- isEmpty()

Here is the code:-


  /**
  * @(#) IsEmptyString.java
  * IsEmptyString class demonstrates the working of isEmpty() method of String class of lang package
  @version 16-May-2008
  @author Rose India Team 
  */  


public class IsEmptyString {
  public static void main(String args[]) {

    String heram = new String("heram");
    // Method isEmpty() returns boolean value false if and only if length of
    // the value is zero
    // .length() method returns the lenght of

    System.out.println("length of the method is returned:  "
        + heram.length() "\n" "Method returns false here:  "
        + heram.isEmpty());
  }
}
Java2html

Output of the program:-
length of the method is returned:  5
Method returns false here:  false

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US