empty : Java Glossary



A zero-length String. i.e. x.length() == 0, e.g. "". If the empty String is interned, you can detect it with:

if ( x == "" )

If not, you can detect them with:

if ( x == null || x.length() == 0 )

One of the most common sources of error in Java programs comes from confusing the three different flavours of void Strings: blank, empty and null.

This page is posted
on the web at:


Optional Replicator mirror
of mindprod.com
on local hard disk J:

Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

Your face IP:[]
You are visitor number