August 1999
Intermediate to advanced
1488 pages
72h 53m
English
boolean.toString()
The toString() method returns the string representation ("true" or "false") of the primitive Boolean value stored in the Boolean object. The return value associated with this object is listed in Table 6.20.
| Type | Description |
|---|---|
| Returns | If true, the string "true" is returned. If false, the string "false" is returned. |
In Listing 6.66, the toString() method is used to force a comparison of strings rather than Boolean values. Without the toString() method, the if comparison would find the Boolean value not equal to the string value.
Read now
Unlock full access