CharSequence isEmpty Method
isEmpty() method added in CharSequence class as a default methid in jdk 15.
isEmpty method:
default boolean isEmpty()
Returns true if this character sequence is empty.
Implementation Requirements:
The default implementation returns the result of calling length() == 0.
Returns:
true if length() is 0, otherwise false
Example:
CharSequence ch = ///Object
if(ch.isEmpty()){
//return true if empty
}
Comments
Post a Comment