The Transient Keyword in Java

The Transient Keyword in Java

Learn about the transient keyword and see its behavior through examples

1. Introduction

In this article, we'll first understand the transient keyword, and then we'll see its behavior through examples.

2. Usage of transient

Let's first understand the serialization before moving to transient as it is used in the context of serialization.

Serialization is the process of converting an object into a byte stream, and deserialization is the opposite of it.

When we mark any variable as transient, then that variable is not serialized. Therefore, the serialization process ignores the original value of the variables and saves default values for that data type.

The transient keyword is useful in a few scenarios:

  • We can use it for derived fields
  • It is useful for fields that do not represent the state of the object
  • We use it for any non-serializable references

java programming developer

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How to Install OpenJDK 11 on CentOS 8

What is OpenJDK? OpenJDk or Open Java Development Kit is a free, open-source framework of the Java Platform, Standard Edition (or Java SE).

Top 10+ Java Development Companies in India & Developers Reviews 2020 –

A thoroughly researched list of top 10 Java development companies in India with ratings & reviews to help find the best java developers around India.

Hire Java Developers Team | Java Developer India -

.DEV is a leading java Developer agency. Our offshore Java Developer Staff offers robust cross-platform java development services at an affordable rate. 1000+ Sucessful Projects, 100+ Happy Customers, 650+ Professionals, 60% Saving on Project Cost

How long does it take to develop/build an app?

This article covers A-Z about the mobile and web app development process and answers your question on how long does it take to develop/build an app.

3 Best Programming Languages for Java Developers

In this article, I’ll share 3 JVM Programming languages Java programmers can learn and why you should learn them. Being a Polyglot developer is of good quality and often valued highly in interviews.