Skip to main content

Posts

Showing posts from May, 2020

1: What is transient in Java

The  transient  keyword in Java is used to indicate that a field should not be part of the serialization (which means saved,  like  to a file) process. Before understanding the  transient  keyword, one has to understand the concept of serialization. What is serialization? Serialization is the process of making the object's state persistent. That means the state of the object is converted into a stream of bytes to be used for persisting (e.g. storing bytes in a file) or transferring (e.g. sending bytes across a network). In the same way, we can use the deserialization to bring back the object's state from bytes. This is one of the important concepts in Java programming because serialization is mostly used in networking programming. The objects that need to be transmitted through the network have to be converted into bytes. For that purpose, every class or interface must implement the  Serializable  interface. It is a marker interface withou...