Can we check string == null?

To check if a string is null or empty in Java, use the == operator . Let’s say we have the following strings. String myStr1 = “Jack Sparrow”; String myStr2 = “”; Let us check both the strings now whether they are null or empty.6 Ara 2018

Sizin İçin Seçtik  How do I check if a string is null in Java 8?

Leave a Reply

Your email address will not be published. Required fields are marked *