isEmpty() vs isBlank() methods in String? Java Interview Questions and Answers

preview_player
Показать описание
isEmpty() vs isBlank() methods in String? Java Interview Questions and Answers | Test Automation Central

Рекомендации по теме
Комментарии
Автор

isEmpty() is false while isBlank is true

edit: ooopps there you already have it in the comment response

isTalong
Автор

isEmpty ---> false
isBlank ----> true

chetanmetkar
Автор

isEmpty will return false and isBlank will return true here.
isEmpty will return true only when String length is zero.
isBlank never worried about length of the String. isBlank returns true if the given String is empty or contains only white space code points. Otherwise isBlank will return false.

RaviShankar-xyzh