• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

basic concepts on Serialization

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I would like to know some basic concepts on Serialization, Transient and Volatile? Any good java tutoiral explaining this with some good examples?
 
Ranch Hand
Posts: 1249
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mark Tigerwood:
Hi all,

I would like to know some basic concepts on Serialization, Transient and Volatile? Any good java tutoiral explaining this with some good examples?



Dear Mark,

You must check this out....

You will definately find so much of you needed..

1. Most Important

another one is
Transient Variables

Hope it helps you out..
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use Google!

When you search for "java serialization tutorial" you'll get a whole list of useful links in a fraction of a second.
 
Mark Tigerwood
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Me too know there is a google engine which will bring us what we needed in a fraction of seconds. Why I am posting is, since this gorup members will know some good tutoirals(with samples/examples) for beginners than the google which will list from advanced. May be a silly question to post, but the below thing managed to post me..


Any way, thanks for your help. And here goes my second question on serializing/deserializing.

I am first serializied the object state in the file called "hi.ser", then when I tried to desrialized I am getting this error:




import java.io.*;

public class BoxRecover{
public static void main(String args[]){

Box myBox = new Box();
try{
FileInputStream fi = new FileInputStream("Hi.ser");
ObjectInputStream oi = new ObjectInputStream(fi);
Box width1 = (Box) oi.readObject();
System.out.println("width ::::::::"+myBox.getWidth());

}catch(Exception e){
e.printStackTrace();
}
}
}
 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An InvalidClassException will be thrown when you change something in your Box class after writing to the file. I have no problems with the files you posted: I can compile and run them and get the expected output.

By the way, for testing purposes you can organize your classes like this:


[ November 11, 2006: Message edited by: sven studde ]
[ November 11, 2006: Message edited by: sven studde ]
 
I once met a man from Nantucket. He had a tiny ad
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic