UrbanPro

Learn Java Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

When to use transient variables?

Asked by Last Modified  

143 Answers

Learn Java

Follow 0
Answer

Please enter your answer

I have 7 years of programming experience and i have worked in india and abroad and currently I am focussing on big data

To know about transient , first we need to know about serialization concept .serialization makes an object's state persistent . It means that the object is converted into stream and store in a file . For any object which has to be transmitted over network needs to be converted into bytes .when you specify...
read more
To know about transient , first we need to know about serialization concept .serialization makes an object's state persistent . It means that the object is converted into stream and store in a file . For any object which has to be transmitted over network needs to be converted into bytes .when you specify transient you don't want the variable to be serialized .usually variables are marked as transient when they can be calculated from other variables .e.g . Say we know length and breadth of rectangle , then we can mark area of rectangle as transient since area is calculated from other variables.hope this helps! read less
Comments

IT professional with 18+ years of exp. in C/C++,Java, Web Technologies, SQL and Corporate Trainer

whenever you want that variable to be not serialized
Comments

Tutor

Transient keyword suggests that the object should not be serialized, nor persisted. For example, when saving an object to a file, the transient variable values are will not be saved to that file when that object is saved to a file. Transient keyword can only be applied to fields or member variable. Applying...
read more
Transient keyword suggests that the object should not be serialized, nor persisted. For example, when saving an object to a file, the transient variable values are will not be saved to that file when that object is saved to a file. Transient keyword can only be applied to fields or member variable. Applying it to method or local variable is compilation error. read less
Comments

International Corporate Trainer For dotnet Core ,Angular 2 ,C ,C++ and LPT Marathi for RBI Banking

variable that is created within an application session. At the end of the session, it is discarded or reset back to its default and not stored in a database. Contrast with persistent variable.
Comments

Java,J2EE,Spring,Webservices,Hibernate,Cloud And Android Expertise

The members which ever you do not want to serialize just prefix with transient.
Comments

Java/J2EE, B.E./B.Tech/MCA SubjectsTraining

When you want a variable to prevent from serialization, use transient keyword.
Comments

Java Certified / Scrum Certified trainer with 8+ year industry experience

A transient variable is , whose state is not persisted. i.e. If you mark a variable as transient and serialize that object having this variable as a member , the state is not saved for future use. So when a de serialization is done the variable will not retain its old value but instead will take its...
read more
A transient variable is , whose state is not persisted. i.e. If you mark a variable as transient and serialize that object having this variable as a member , the state is not saved for future use. So when a de serialization is done the variable will not retain its old value but instead will take its default. , read less
Comments

Software Developer, Expertise in Java/J2ee Technology.

Transient variables are useful :- when you want to transfer object on a network and don't want any particular variable of that object to be part of that transfer. So, use transient only on that variable. In this way all variables of the object will travel over the network with their current state except...
read more
Transient variables are useful :- when you want to transfer object on a network and don't want any particular variable of that object to be part of that transfer. So, use transient only on that variable. In this way all variables of the object will travel over the network with their current state except the transient variable. Serialization : It is a process of making object ready to move over network. It basically converts the object to sequence of bytes. read less
Comments

7 yrs Experience along with Microsoft Certified Technology Specialist Trainer for .Net with C# as Language

If you mark an instance field of a Java class as 'transient', it means that it is not part of the persistent state of an object of that class. Its main use is when you're serializing an object. Any fields marked as 'transient' are simply ignored in the serialization process. This is equivalent in...
read more
If you mark an instance field of a Java class as 'transient', it means that it is not part of the persistent state of an object of that class. Its main use is when you're serializing an object. Any fields marked as 'transient' are simply ignored in the serialization process. This is equivalent in C# to marking a field with the NonSerialized attribute. read less
Comments

Tutor

transient variables are never serialized in java. It marks a member variable not to be serialized when it is persisted to streams of bytes. When an object is transferred through the network, the object needs to be 'serialized'. Serialization converts the object state to serial bytes. Those bytes are...
read more
transient variables are never serialized in java. It marks a member variable not to be serialized when it is persisted to streams of bytes. When an object is transferred through the network, the object needs to be 'serialized'. Serialization converts the object state to serial bytes. Those bytes are sent over the network and the object is recreated from those bytes. Member variables marked by the java transient keyword are not transferred, they are lost intentionally. please have a look at what serialization is.? and also refer this read less
Comments

View 141 more Answers

Related Questions

Hi , this is Mithun Ghosh from Kolkata. I want a suggestion about the course content of teaching Java starting from core to Advanced level. Please anyone do help with a legible course content. Thanks in advance -- Thanks & Regards, Mithun Ghosh
Hi Mithun, This is AkiraITSolutions, We do provide real time training with real time employees, who ever having more than 10 years of IT Experience. For further details please feel free to reach us.
Mithun Ghosh
Is it good to go for a Java coaching center and learn Java (with advanced Java) to improve my programming skills?
yes, Please check the Institute reviews and discuss with the tutor, what topics were covered in class. Ask about the practicals session and how many hours/duration of the course.
Gerda
0 0
5
When we are used the compiler and interpreter? what is the difference between them?
Java code is the best example of compiled as well as interpreted. Java Compiler does the task of compiling . Java file to .class file(binary form). JVM works as interpreter to let Operating system understand the compiled code instructions.
Shilpa
Is there any difference between Serializalble and Externalizable interface?
1. In case of Serializable, default serialization process is used. while in case of Externalizable custom Serialization process is used which is implemented by application. 2. JVM gives call back...
Vathsala
Can you tell me some new features in JavaFX 2.0?
JavaFX is a software platform for creating and delivering desktop applications, as well as rich internet applications (RIAs) that can run across a wide variety of devices. JavaFX is intended to replace...
Renuka
0 0
5

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Thread Class In JAVA
Thread Class: Thread class is the main class on which Java's Multithreading system is based. Thread class, along with its companion interface Runnable will be used to create and run threads for utilizing...

Puzzle Game coding
import java.awt.BorderLayout;import java.awt.Color;import java.awt.Dimension;import java.awt.Font;import java.awt.FontMetrics;import java.awt.Graphics;import java.awt.Graphics2D;import java.awt.RenderingHints;import...

How To Setup development Environment Of Java?
After installation of JAVA, we need to setup 2 environment variables. First one is JAVA_HOME and second is Path. Below steps to set up Java environment to compile & execute Java programs from command...

Spring - Dependency Injection (DI)
Spring - Dependency Injection (DI) DI is a framework which provides loose coupling in code. Here loose coupling means no hard coding of the object. Instead of hard coding, we will be injecting these object...

Crux Of The Basic Interview Question Asked Around It Professionals
Question: Explain PSVM() in Java. Answer: This question is asked from a differnet persctive. Person asking this question is looking for deep java concepts. If answer in your mind is something like...

Recommended Articles

Java is the most famous programming language till date. 20 years is a big time for any programming language to survive and gain strength. Java has been proved to be one of the most reliable programming languages for networked computers. source:techcentral.com Java was developed to pertain over the Internet. Over...

Read full article >

Java is the most commonly used popular programming language for the creation of web applications and platform today. Integrated Cloud Applications and Platform Services Oracle says, “Java developers worldwide has over 9 million and runs approximately 3 billion mobile phones”.  Right from its first implication as java 1.0...

Read full article >

In the domain of Information Technology, there is always a lot to learn and implement. However, some technologies have a relatively higher demand than the rest of the others. So here are some popular IT courses for the present and upcoming future: Cloud Computing Cloud Computing is a computing technique which is used...

Read full article >

Designed in a flexible and user-friendly demeanor, Java is the most commonly used programming language for the creation of web applications and platform. It allows developers to “write once, run anywhere” (WORA). It is general-purpose, a high-level programming language developed by Sun Microsystem. Initially known as an...

Read full article >

Looking for Java Training Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for Java Training Classes?

The best tutors for Java Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Java Training with the Best Tutors

The best Tutors for Java Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more