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

Where can I get Python online training?
You can get many institutes in google which are providing online training.
Taranum
What are the different types of Exceptions in Java?
Null pointer exception ArrayOutOfIndex exception DivideByZero exception
Aakanksha
Should we learn DBMS and RDBMS without any Java training?
java or i can say any programming language is not required to learn DBMS or RDBMS
Karthik
0 0
6
best source to learn java from?
Main source if information on Java is oracle documentation. But it takes your time to read through, a lot more than you expect. Better prefer a trainer who can give what you need.
Himanshu

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

Ask a Question

Related Lessons

10 Cool SQL Optimizations That Do Not Depend On The Cost Model
Today, we don’t want to talk about cost based optimisation, i.e. optimisations that depend on a database’s cost model. We’ll look into much simpler optimisations that can be implemented...

JAVA OOPs Concepts (Object-Oriented Programming System)
JAVA OOPs Concepts (Object-Oriented Programming System) It is primarily having below crucial points. Without below essential points, we will never be able to achieve OOPs in java, PHP, C#, etc. Now let...

Overloading in JAVA
When a class contains more than one method with the same method name but different argument types, then it is called Overloading. Methods are said to be Overloaded methods. Also, know as Compile time...

How to create a Singleton class?
How to create a Singleton class: Q) What is a singleton class? A) In simple words, a singleton class is a class which can have only one instance at any point of time throughout the application and provides...

Understanding concept of Inheritance in Java
Inheritance: Acquiring a properties and methods from Parent class to Child class. For example, In some cases we can hear from any one of your relative or your friends will say like that "You are bahaving...

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