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

What's Java's most used IDE?
As per Dzone's recent survey, The Eclipse IDE remains the most popular place for Java developers to primarily write their code, though it saw a 7% decrease from last year’s survey results (50% in 2016...
Ritu
0 0
7
What is selection sort in java?
Selection sort is a sorting algorithm. You can implement this algorithm in any language. The basic idea is to select the smallest element of the array and placing it to the head of array. This step needs...
Snehashis
How to handle Circular dependency in Spring?
What I would like to do in this post is suggest 3 possible techniques for dealing with this problem. 1. Refactor your code This is probably the simplest and quickest way to fix this problem. Look at...
Saroj
Why we are using this keyword in Java?
"this" keyword is use to refer an object of current class it is also use for call specific constructor of current class if more than one constructor is declared.
Kiran
0 0
9
What is serialization?
serialization is a storing the state of the object into the file
Shubham

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

Ask a Question

Related Lessons

What Is Java? Explain The History Of Java
i. Ovierview: Java programming language was originally developed by Sun Microsystems which was initiated by James Gosling and released in 1995 as core component of Sun Microsystems' Java platform (Java...

CoreJAVA
Core Java Training High Level Course Content Trained by Java Architect 1. Core Java Programming Introduction of Java 2. Data types and Operators 3. Control Flow statements 4. OOPS and its application...
A

Java Hash Map internal implementation
1.Hash Map internal implementation: In hash map it will create an array of table (to store the {Key,Value} pair) which is of type java.util.HashMap.EntryThe Entry object contains {hash, key, next, value}...
R

Facebook Analytics
Assume how the Facebook application will store the millions of customer's record in real-time: facebook = { 'jose': { 'name': 'jose', 'age': 33, 'hobby': , # cricket,football 'mobile': 1111111111, 'email':...

Class, Object and Methods in JAVA
Lesson-1: Class, Object and Methods of Java can be compared with body, heart and brain. Without these 3 things, Java does not exist. If you Google the above 3 items, you will find many definitions. But...

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