Javatpoint Logo
Javatpoint Logo

Java ObjectInputStream readBoolean() Method

The readBoolean() method of the java.io.ObjectInputStream class is used to read the data of Boolean type. It returns true if the byte is non zero, false if the byte is zero.

Syntax

Parameter

No parameter is passed.

Returns

true/false.

Throws

EOFException - If the end of file is reached.

IOException - If other I/O error has occurred.

Example 1

Output:

Hello
javaTpoint
byte is non Zero

Example 2

Output:

Hello
javaTpoint
byte is  Zero





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA