$ thought | blog

Place to serialize my thoughts…

Java: static and transient keywords

with one comment

I came across transient keyword and wanted to get few more details about it. This is one of the most ignored or rarely used keyword by me. It is really funny but, I never really used this keyword extensively. The main reason is, this keyword has a very specific use and most of the applications don't need that for building the business applications. As per info here, when any object state is getting serialized, static and transient variables will be ignored for serialization. Still, Java compiler doesn't give any warning or prohibit from making a variable static and transient at the same time. I don't think this as error but a warning should make more sense in this case.

Written by Sachin

April 20th, 2008 at 9:37 pm

Posted in Java,Programming

Tagged with ,

One Response to 'Java: static and transient keywords'

Subscribe to comments with RSS or TrackBack to 'Java: static and transient keywords'.

  1. hi sir
    i want to know the static in deep.static alocat space in the memory for variables,objects,methods etc declared in the class
    but at run time how overriden done

    aarif

    26 Jul 08 at 10:03 am

Leave a Reply