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

will I get certificate
Better than certificate if you enroll with me you will get confidence and lot of practical knowledge...certifications dont matter after a period of time what really matters is your approach to a problem...
Sk.

 I want to learn from beginning, please tell me what is the best source to learn (core java)

hi sunaini It is very good that you want to learn programming... I would recommend you c,c++,java and dotnet courses...for becoming a good provrammer.. we provide online training..at lowest prices if...
Sunaini
What are the different types of Exceptions in Java?
Null pointer exception ArrayOutOfIndex exception DivideByZero exception
Aakanksha
What is the difference between a C program execution and a Java program execution?
When we compile C program then it convert into exe file ie Machine language with the help of OS lib file which is platform dependent . If we compile java prgram then it convert into class file with the...
Kaushal
0 0
5
What is the general syllabus covered in core Java training from any institution?
you can check the syallbus on http://felix-its.com/java-training-pune/
Shiv Kohli
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

Java Overview
Java platform overview Java platform components The Java platform consists of the following components. The Java language Like any programming language, the Java language has its own structure, syntax...
A

Akshay Shende

0 0
0

Class and Objects in Java
Class is a template or a blueprint which is used to describe an object. On other hand Object is a reference of a class which follows all the stuff written inside the class. How about taking the whole tour in the following video

Difference Of Inheritance In C++ And Java
In Java , multiple inheritance is not applicable directly but we can implement the concept by using the interfaces. In c++ and Java, the common types of inheritances are: Single Multi level Hybrid Hierarchical

Core Java
Introduction: An Object Oriented Programming Language consists of Objects. There are object oriented programming languages like Smalltalk, C++. Each and every OOP language has some underlying disadvantages....

Necessity of Theory and Practical in Computer Science.
Upon studying a subject both theory and practical are important. Usually many schools concentrate more on theory and the marks not on the practical. Other and opposite kind of people prefer practical...

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