Comment

kapil
transient,
January 19, 2009 at 8:49 PM

Transient variables cannot be serialized. The fields marked transient in a serializable object will not be transmitted in the byte stream. An example would be a file handle or a database connection. Such objects are only meaningful locally. So they should be marked as transient in a serializable class.

view plaincopy to clipboardprint?
class Sample implements Serializable {

private int number; //gets serialized
private String name; //gets serialized
private [B]transient[/B] Connection con = null; // does not get serialized

...

public void method() {
....
}

}
View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Java Beginners

CoreJava
 

Java Interview Questions

corejava
 

Java Beginners

corejava
 

Java Beginners

transient keyword
transient keyword  how to use transient keyword?   Hi Friend, The transient keyword is used to indicate that the member variable should not be serialized when the class instance containing that transient variable 

Java Beginners

transient keyword - Java Beginners
transient keyword  what is transient keyword in java.? plz explain with example 

Java Beginners

transient variables in java
transient variables in java  hello, What are transient variables in java?   hii, Transient variables are variable that cannot be serialized 

Java Beginners

CoreJava Project
CoreJava Project  Hi Sir, I need a simple project(using core Java, Swings, JDBC) on core Java... If you have please send to my account 

Hibernate Interview Questions

Transient and detached objects
Transient and detached objects  Explain the difference between transient (i.e. newly instantiated) and detached objects in hibernate 

Java Beginners

What is a transient variable?
What is a transient variable?   Hi, What is a transient variable...) with transient keyword becomes transient variable in java. It will be beneficiary... to transient variable. The Serialization is a process in which the object's state 

General

transient Java Keyword
transient Java Keyword       The transient is a keyword defined in the java programming language... to a compiler in java programming language likewise the transient keyword indicates 

Programming Tutorials

Corejava Interview,Corejava questions,Corejava Interview Questions,Corejava
 

Programming Tutorials

Corejava Interview,Corejava questions,Corejava Interview Questions,Corejava
 

Programming Tutorials

Corejava Interview,Corejava questions,Corejava Interview Questions,Corejava
 

Programming Tutorials

Corejava Interview,Corejava questions,Corejava Interview Questions,Corejava
 

Core Java

Keyword- transient
Keyword- transient       The transient keyword is used to indicate to the JVM that the indicated... the object is archived. At that time, the transient marker is ignored by the Java 

Java Beginners

java Transient variable - Java Beginners
java Transient variable  Hi, What is the use of transient variables in java?  Hi friend, The transient is a keyword defined... the transient keyword indicates the following : -- The transient keyword 

Java-Tutorials

Transient Java Keyword
Transient Java Keyword In this section we will discuss about transient keyword in java. Transient is a keyword in java which is used to prevent any variable being serialized. Before going into details about transient we will try 

Java Beginners

corejava - Java Beginners
corejava pass by value semantics  Example of pass by value semantics in Core Java.  Hi friend,Java passes parameters to methods using pass by value semantics. That is, a copy of the value of each of the specified 

Java-Tutorials

Java Transient Variable
Java Transient Variables Before knowing the transient variable you should firs... mark that object as persistent. You can also say that the transient variable is a variable whose state does not  Serialized. An example of transient 

Java Beginners

corejava - Java Beginners
 

Java Beginners

corejava - Java Beginners
 

Java Beginners

corejava - Java Beginners
 

Java Beginners

corejava - Java Beginners
 

Java Beginners

corejava - Java Beginners
 

Java Beginners

corejava - Java Beginners
 

Java Interview Questions

Corejava - Java Interview Questions
 

Java Beginners

corejava - Java Beginners
 

Java Interview Questions

corejava - Java Interview Questions
 

Java Interview Questions

corejava - Java Interview Questions
 

Java Interview Questions

corejava - Java Interview Questions
 

Java Interview Questions

corejava - Java Interview Questions
 

Java Interview Questions

corejava - Java Interview Questions
 

Java Interview Questions

corejava - Java Interview Questions
 

Java Beginners

CoreJava - Java Beginners
 

Java-Tutorials

What is Transient variable in Java
Transient variable in Java is used to show that a particular field should not be serialized when the class instance containing that transient variable being..., just add Transient keyword and it will not be considered or will be ignored 

General

K - Java Glossary
K - Java Glossary       Keyword- transient The transient keyword is used to indicate... are required to be saved when the object is archived. At that time, the transient 

General

SCJP Module-11 Question-5
; public String address; 6    public transient int ccode; } What will be the effect of line no-6 ? Choose the correct option? (A) A transient variable is a variable that are not serialized.(B) A transient variable 

JSP Servlet Questions

autentication & authorisation - JSP-Servlet
/interviewquestions/corejava/null-marker-interfaces-in-java.shtml Thanks 

General

Core Java Interview Questions!
;    Question: What is transient variable? Answer: Transient variable can't be serialize. For example if a variable is declared as transient in a Serializable class and the class is written 

General

K - Java Glossary
 

Java Beginners

JList
JList  pls tell me about the concept the JList in corejava? and tell me a suitable example 

Java Server Faces Questions

java - Java Server Faces Questions
java  Java Server Faces Quedtions  Hi friend, http://www.roseindia.net/interviewquestions/jsf/ http://www.roseindia.net/interviewquestions/jsf/JSF-interview-questions.shtml Thanks 

Hibernate Questions

qestions
qestions  what is detached object? what is transient object 

Java Beginners

java basics
java basics  What is the use of transient keyword?  The transient keyword is applicable to the member variables of a class. The transient... when the class instance containing that transient variable is needed 

Java Interview Questions

java
java  What are Transient and Volatile Modifiers?  Transient: The transient modifier applies to variable only, and it is not stored as part of it's objects persistent state.Transient variables are not serialized 

Java Interview Questions

interview questin of java - Java Interview Questions
://www.roseindia.net/interviewquestions/corejava.shtml http://www.roseindia.net/interviewquestions/ Thanks & Regards Amardeep 

Java Beginners

core java - Java Beginners
Core Java interview Help   Core Java interview questions with answers  Hi friend,Read for more information.http://roseindia.net/interviewquestions 

Servlet Interview Questions

java - Servlet Interview Questions
java  servlet interview questions  Hi friend, For Servlet interview Questions visit to : http://www.roseindia.net/interviewquestions/servlet/ Thanks 

Java Interview Questions

java
java transient,native and volatile access modifier  1.what is the use of transient,native and volatile (access modifier)...? 2.why are we using MVC modle in our java project 

Java Interview Questions

java
java what is the use of transient,native and volatile access modifier  1.what is the use of transient,native and volatile (access modifier)? 2.why are we using MVC modle in our java project 

Java Interview Questions

core java - Java Interview Questions
core java  What are transient variables in java? Give some examples  Hi friend, The transient is a keyword defined in the java... relevant to a compiler in java programming language likewise the transient 

JSP Servlet Questions

Servlets - JSP-Servlet
Servlets  How can we differentiate the doGet() and doPost() methods in Servlets  Hi friend, Difference between doGet() and doPost() http://www.roseindia.net/interviewquestions/servlet/ Thanks 

Struts Questions

JAVA - Struts
://www.roseindia.net/interviewquestions/strutsinterviewquestions.shtmlcheck the above link 

Java Beginners

java apptitude question and answers - Java Beginners
java apptitude question and answers  i want java appititude question and answers  Hi Friend, Please visit the following link: http://www.roseindia.net/interviewquestions/ Thanks 

Java Beginners

Java code - Java Beginners
and transient modifiers with an example? Thank you in advance  Hi friend, Hi friend, The transient is a keyword defined in the java programming language... to a compiler in java programming language likewise the transient keyword indicates 

Java Beginners

core java - Java Beginners
core java  how to create a login page using only corejava(not servlets,jsp,hibernate,springs,structs)and that created loginpage contains database(ms-access) the database contains data what ever u r enter and automatically date 

Java Beginners

core java
core java  java program using transient variable   Hi Friend, A transient variable is a variable that may not be serialized.The transient... TransientVariable{ String name; transient String pass; public TransientVariable(String 

Core Java

Java questionnaire
:/www.roseindia.net/interviewquestions/corejava.shtml Or If you want to go... ?     Page 12 What is a transient 

Java Interview Questions

about c and java
://www.roseindia.net/c-tutorials/ http://www.roseindia.net/interviewquestions 

Struts Questions

IMP - Struts
: http://www.roseindia.net/interviewquestions 

Java Interview Questions

Java Interview - Java Interview Questions
. http://www.roseindia.net/interviewquestions/ Thanks 

JSP Interview Questions

java - JSP-Interview Questions
java  hi.. snd some JSP interview Q&A and i wnt the JNI(Java Native Interface) concepts matrial thanks krishna  Hi friend, Read more information. http://www.roseindia.net/interviewquestions/jsp-interview 

Java Beginners

Hello - Java Beginners
this link.... http://www.roseindia.net/interviewquestions/ Thanks 

Java Interview Questions

hint - Java Interview Questions
hint  Dear roseindia, i want the java interview question and the corresponding question answers.   Hi Friend, Please visit the following link: http://roseindia.net/interviewquestions/ Here you will get lot 

Java Interview Questions

java - Java Interview Questions
java  i want to java&j2ee interview questions. Regards Akhilesh Kumar  Hi friend, I am sending you a link. This link will help you. Read for more information. http://www.roseindia.net/interviewquestions 

Java Interview Questions

interview question - Java Interview Questions
interview question  hello i want technical interview question in current year   Hi Friend, Please visit the following links: http://www.roseindia.net/interviewquestions/ http://www.roseindia.net 

Java Beginners

java - Java Beginners
://www.roseindia.net/interviewquestions/ Thanks 

Java Interview Questions

assert,access modfier - Java Interview Questions
/javatutorials/use-assertion-in-java.shtml Transient Modifier: The transient... as transient.It will not be written out. Transient variables can be declared as 'final 

Hibernate Questions

hibernate object states and life cycle
hibernate object states and life cycle  I am bit confused in between the hibernate states and it's life cycle. Can you please explain this also? also explain the persistent, detached and transient object states.Thanks 

Java Interview Questions

java
why are we using MVC modle in our java project..  1.what is the use of transient,native and volatile (access modifier)...? 2.why are we using MVC modle in our java project 

Java Beginners

Serialize the static variable
Serialize the static variable  hello, Can we serialize the static variable?   hii Yes we can serialize the static variable. if u don't want to serialize, u need to declare the variable as transient 

Java Beginners

java - Java Beginners
java  i am trying to serialize a transient object which is non-serializable .after serialization the object should restore the reference which was initially assigned. is it possible 

Java Beginners

HOW TO BECOME A GOOD PROGRAMMER
HOW TO BECOME A GOOD PROGRAMMER  I want to know how to become good programmer   Hi Friend, Please go through the following link: CoreJava Tutorials Here you will get lot of examples with illustration where you can 

Java Beginners

What is Locale - Java Beginners
://www.roseindia.net/tutorial/java/corejava/javatext 

IDE Questions

Eclipse - IDE Questions
Eclipse  Hi To All.. I am new to ECLIPSE IDE. Please suggest me any book which can give me complete idea of setting environment and development with basic to advance development of java like(corejava,servlet,jsp,struts,ejb 

Java Interview Questions

Java Locale
/corejava/javatext/parseAndFormatDateUsingLocale.html Thanks 

Hibernate Questions

HibernateTemplate
property references a null or transient value 

General

SCJP Module-11 Question-6
To have serialization what necessary steps to be followed ? Choose correct options? (A) Remove transient variable if any specified. (B) Class must implements Serializable interface. (C) Import of java.io.* is necessary.(D) Must 

EJB Questions

interview questions - EJB
/interviewquestions/One more thing first of all you should sound in programming language 

Java Beginners

hi all - Java Beginners
for more information. http://www.roseindia.net/interviewquestions 

Struts Questions

java - Struts
://www.roseindia.net/interviewquestions/ Thanks 

Java Interview Questions

java - Java Interview Questions
/interviewquestions/corejava.shtml I think this is enough.. but u can see http 

Java Interview Questions

Java - Java Interview Questions
link.http://www.roseindia.net/interviewquestions 

Java Interview Questions

java questions - Java Interview Questions
://www.roseindia.net/interviewquestions/ Thanks 

Java Beginners

Keywords - Java Beginners
Keywords  what is const,volatile,assert,transient,instanceof i know... ; assert balance > 0; assert isCondition(); transient : The transient... when the class instance containing that transient variable is needed 

Java Beginners

want to get job on java - Java Beginners
/interviewquestions/http://www.roseindia.net/interviewquestions/j2ee-interview 

Struts Questions

java - Struts
/interviewquestions/design-patterns/design-patterns-interview-questions1.shtml 

Servlet Interview Questions

interview question - Servlet Interview Questions
can visit here at http://www.roseindia.net/interviewquestions/servlet 

Java Beginners

Inter Thread Communication
://www.devmanuals.com/tutorials/java/corejava/InterthreadCommunication.html 

Java Interview Questions

how to count words in string using java
how to count words in string using java  how to count words in string using corejava   Hi Friend, Try the following code: import java.util.*; class CountWords{ public static void main(String[] args 

Java Interview Questions

What happens to the static fields of a class during serialization?
fields are only handled if the base class itself is serializable. Transient fields 

Java Interview Questions

JAVA - Java Interview Questions
JAVA  What is SERIALIZATION?  Serialization is the process of storing the state of an object in to storage medium. if a variable is transient then we can't store it in storage mediums like hard disk, etc. Thanks...  

Java-Tutorials

Factorial Program in Java
"); } } } Output C:\Documents and Settings\bharat\Desktop\bipul\CoreJava\Swing Example...\bipul\CoreJava\Swing Example\Factorial> java Factorial1 enter 

Java-Tutorials

Serialization in java
address; transient int age; } While making an object serialized two points... then it should mark as transient.  Code how to serialized an object  ... name; String address; transient int age; Demo(String name,String address,int 

Java Interview Questions

java - Java Interview Questions
/interviewquestions/ Here you will get lot of interview questions 

Java Beginners

JAVA - Java Beginners
Access specifiers Java  Need example of Access Specifiers.  Core Java Interview questionshttp://www.roseindia.net/interviewquestions/corejava.shtml  Access specifiers are used to Controlling Access to Members 

Java Server Faces Questions

Java - Java Server Faces Questions
://www.roseindia.net/jsf/ http://www.roseindia.net/interviewquestions/jsf/JSF 

Java Interview Questions

java - Java Interview Questions
or volatile and/or static and/or transient. Thanks   Hi friend... and/or transient. For read more information to visit ... http://www.roseindia.net 

Hibernate Questions

What are POJOs and what’s their significance?
What are POJOs and what?s their significance?  Hi, What are POJOs and what?s their significance? Thanks,   Hi, In POJO (Plain Old Java Object) class object there are three types of states i.e. Transient state 

Java Interview Questions

java
keyword: final , volatile, static, transient, abstract, native, synchronized 

Advertisements Advertisements
 

 

 

DMCA.com