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

Can anyone know if there are tools/apps for representing the objects/classes/methods in the JVM in pictorial way?
rational rose and ibm software architect can be used for design and representation
Raghavendra Reddy
0 0
7
Which book is good for groovy and grails
Beginning Groovy and Grails: From Novice to Professional by Jim Shingler (Author), Joseph Faisal Nusairat (Author), Christopher M Judd (Author)....
Sumit S.
hi this iz sunil here I done with my b.sc in cs and planning to go fr java course shld I prefer for institution or a lecturer who teaches java at his own tuitions ...
i can teach you java the way you can play with real world thinking you don't need of knowledge of any other language. you can directly learn java
Sunil
0 0
5
As a fresher I have done Python training, but hardly getting response from any company. What should I do?
only having training in Python is not enough to be called for intervew. Better you should get real time certification course form reputed organisation with smart hand-on real project exposure. Try to have...
Yamini
0 0
6

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

Ask a Question

Related Lessons

Software Testing
Software testing is a process of executing a program or application with the intent of finding the software bugs. It can also be stated as the process of validating and verifying that a software program...

Differences Between HashMap vs HashSet In Java.
HashSet HashMap HashSet implements Set interface. HashMap implements Map interface. HashSet stores the data as objects. HashMap stores the data as key-value pairs. HashSet...

Observer Pattern in Java.
As I was going through the different source code files of the Java Util package, I found the implementation of the Observer Pattern ( see the Gang of Four books for more information on this pattern) in...

What are the JSP implicit objects ?
JSP provides Nine implicit objects by default. They are as follows with corresponding Object Type: i) out --> JspWriter ii) request -->HttpServletRequest iii) response --> HttpServletResponse iv)...

Final modifier in Java
Can’t change value of variable if marked as final. It is best practice to mark method parameter as final if its value will not changes. Variable must be initialize either using Initializer block...

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