aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes about serialization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "about serialization" Watch "about serialization" New topic
Author

about serialization

karnatam narendraprasad
Ranch Hand

Joined: Mar 01, 2007
Posts: 30

in the above collar is not serilazed. but the program excutes fine .what is the use of "transient"


EDIT by mw: Added Code Tags -- please use these when posting code.
[ March 16, 2007: Message edited by: marc weber ]
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by karnatam narendraprasad:
...in the above collar is not serilazed. but the program excutes fine .what is the use of "transient"

JLS - 8.3.1.3 transient Fields: "Variables may be marked transient to indicate that they are not part of the persistent state of an object."

It might look like your program "executes fine," but it's not really doing what you think it's doing. It's a bad habit to catch an exception and do nothing with it -- for example...

If you add System.err.println(e); to your catch blocks, you should see what's really happening here.
[ March 16, 2007: Message edited by: marc weber ]

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: about serialization