Null,empty and blank .

Null,empty and blank .

Table of contents

No heading

No headings in the article.

Null indicates there is no value at all within a database field for a given record. It does not mean or represent zero, because zero is a value. Null is simply the word used to show the absence of any data in that field. The code String nullString = null assigns a null value to the variable nullString.

A blank string indicates a value within a database, but the field is blank. contains only whitespaces, is neither empty nor null since it does have an assigned value, and isn't of 0 length (an empty string).

An empty string refers to an object that has been assigned a value but whose length is zero. The code snippet String emptyString = '' assigns an empty string value to the variable emptyString.