ObjectOutputStream.PutField

Introduction

The Java.io.ObjectOutputStream.PutField class provide programmatic access to the persistent fields to be written to ObjectOutput.

Class declaration

Following is the declaration for Java.io.ObjectOutputStream.PutField class −

public abstract static class ObjectOutputStream.PutField
   extends Object

Learn Java in-depth with real-world projects through our Java certification course. Enroll and become a certified expert to boost your career.

Class constructors

Sr.No.Constructor & Description
1ObjectOutputStream.PutField()Single Constructor

Class methods

Sr.No.Method & Description
1abstract void put(String name, boolean val)This method puts the value of the named boolean field into the persistent field.
2abstract void put(String name, byte val)This method puts the value of the named byte field into the persistent field.
3abstract void put(String name, char val)This method puts the value of the named char field into the persistent field.
4abstract void put(String name, double val)This method puts the value of the named double field into the persistent field.
5abstract void put(String name, float val)This method puts the value of the named float field into the persistent field.
6abstract void put(String name, int val)This method puts the value of the named int field into the persistent field.
7abstract void put(String name, long val)This method puts the value of the named long field into the persistent field.
8abstract void put(String name, Object val)This method puts the value of the named Object field into the persistent field.
9abstract void put(String name, short val)This method puts the value of the named short field into the persistent field.

Methods inherited

This class inherits methods from the following classes −

  • Java.io.Object

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *