Home » Java ObjectInputStream readUTF() Method with Examples

Java ObjectInputStream readUTF() Method with Examples

by Online Tutorials Library

Java ObjectInputStream readUTF() Method

The readUTF() method of ObjectInputStream class is used to read a String in UTF(Uniform Text Format) format. It returns the String which is read from objectinputstream in UTF format.

Syntax

Parameter

NA

Returns

The String.

Throws

IOException

UTFDataFormatException

Example 1

Output:

tutorAspire  welcome to TutorAspire 

Example 2

Output:

Use of readUTF() : Welcome to TutorAspire 

You may also like