Results 1 to 7 of 7
  1. #1
    java4amanda is offline Member
    Join Date
    Jan 2012
    Posts
    55
    Rep Power
    0

    Default Tranisent method

    Hi all,


    Can a method be tranisent?

    Thank you.

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default Re: Tranisent method

    What does the compiler say?

  3. #3
    java4amanda is offline Member
    Join Date
    Jan 2012
    Posts
    55
    Rep Power
    0

    Default Re: Tranisent method

    well it says modifier transient not allowed here!!!

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,368
    Blog Entries
    7
    Rep Power
    20

    Default Re: Tranisent method

    Quote Originally Posted by java4amanda View Post
    well it says modifier transient not allowed here!!!
    So, can a method be transient? Three guesses ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    java4amanda is offline Member
    Join Date
    Jan 2012
    Posts
    55
    Rep Power
    0

    Default Re: Tranisent method

    no i guess since it relates to the instance variables which signifies the state of an object and is required to be saved during serialization in order to retain the state???

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,368
    Blog Entries
    7
    Rep Power
    20

    Default Re: Tranisent method

    Quote Originally Posted by java4amanda View Post
    no i guess since it relates to the instance variables which signifies the state of an object and is required to be saved during serialization in order to retain the state???
    Yep, correct; transient member variables aren't serialized, that's all there is to it.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  7. #7
    java4amanda is offline Member
    Join Date
    Jan 2012
    Posts
    55
    Rep Power
    0

Similar Threads

  1. Replies: 1
    Last Post: 10-17-2011, 01:00 AM
  2. Declaring a method inside a method: Runnable?
    By africanhacker in forum New To Java
    Replies: 8
    Last Post: 03-23-2011, 04:30 AM
  3. Turning Recursion Method into Iterative method
    By mattakuevan in forum New To Java
    Replies: 9
    Last Post: 06-15-2010, 06:46 AM
  4. Replies: 2
    Last Post: 03-26-2010, 05:12 PM
  5. ArrayLists compareTo method, equals method
    By random0munky in forum New To Java
    Replies: 2
    Last Post: 10-26-2009, 07:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •