Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about serialization

 
karnatam narendraprasad
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic