Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

can a method can be serialized?

 
rajareddy annavaarm
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1)can a method can be serialized?
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This sounds like a homework question. What do you think? Have you tried to serialize a method? Have you read the serialization documentation?
 
Saurabh Patil
Ranch Hand
Posts: 48
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having beginner's knowledge but as far as my knowledge goes methods cant be serialized. "Serializable" is an interface which has to be implemented by the class whose object we wish to serialize. Serializing any object is nothing but storing it on secondary memory ( a hard disk) so that it can be retrieved later. I think applying serializable concept to methods itself makes no sense. Seniors please correct me if i am wrong.
 
prakash chandra
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Serialization actually serialize the object along with their data i.e variables. Not method because serialization saves the states of object. States of object means the values of object's variables at a given time. Methods are just for applying logic and manipulating the values of variables. Methods dont contribute towards the state of object. So, methods are not serialized.
 
Saurabh Patil
Ranch Hand
Posts: 48
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeh.. thats what i meant. Thanks prakash for clearing the matter.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!