isBlank() vs isEmpty() in String class Java

isBlank() is a new method introduced in String class in Java. By naming isBlank() and isEmpty() methods look similar to each other, but there is a slight difference between them – isBlank() returns true for the string having only white space characters whereas isEmpty() will return false for such strings. Let us understand the difference … Read more

Local vs Instance vs Class vs Reference variable in Java

In Java we have 4 type of variables :- Local Variable Instance Variable Class variable Reference variable Java developers often get confused while using these terms, let us understand the difference between them in detail : Local Variable Local variables are those which are defined inside a block, method or constructor. These variables get destroyed … Read more