Question: Serialization and deserialization

Ads

 
 
 

Share on Google+Share on Google+

Bhavya
Serialization and deserialization
1 Answer(s)      9 years ago
Posted in : Java Beginners

I am learning java these days... thread and we want that when the first thread is done with the serialization it should notify the second thread that serialization is done and it can initiate

Ads
View Answers

April 14, 2008 at 7:18 PM


Hi


import java.io.*;

public class DeserializingExample{

public static void main(String[] args) throws IOException{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter File name : ");

String file = in.readLine();

System.out.print("Enter extention : ");

String ext = in.readLine();

String filename = file + "." + ext;

File f = new File(filename);

try{

ObjectInputStream obj = new ObjectInputStream(new FileInputStream(f));
System.out.println("The text : "+ obj.readObject());
obj.close();
System.out.println("Deserializing Operation Completly Successfully.");

}

catch(ClassNotFoundException e){

System.out.println(e.getMessage());

}

catch(FileNotFoundException fe){

System.out.println("File not found ");

}

}

}

-----------------------------------

Read for more information,

http://www.roseindia.net/java/example/java/io/

Ads









Related Tutorials/Questions & Answers:
Serialization and deserialization - Java Beginners
Serialization and deserialization  I am learning java these days... thread and we want that when the first thread is done with the serialization it should notify the second thread that serialization is done and it can initiate
Serialization
Serialization  hello What is serialization?   Hello, In Serialization we can save the state of an object by converting it to a byte stream
Advertisements
serialization of objects
serialization of objects  example for serialization plz
serialization concept
serialization concept  what is the exact purpose of serialization in detail
java serialization
java serialization  java serialization
Java serialization
Java serialization  What is the common usage of serialization
serializable & serialization
serializable & serialization  what is the difference between serializable and serialization in java
Java Interview Questions - Page 12
;    Question: What is Serialization and deserialization?  Answer: Serialization is the process of writing the state of an object to a byte stream. Deserialization is the process
Serialization - Java Interview Questions
Serialization Interface  I am a beginner in java.. What is serialization? what happens if we implement Serialization interface? Thanks in advance
Object serialization - Java Beginners
Object serialization  Design classes for Currency, Rupee, and Dollar. Write a program that randomly generates Rupee and Dollar objects and write them into a file using object serialization. Write another program to read
Serialization in java
Serialization in java In this section you will learn about serialization in java. Serialization is the process of writing the state of the object... method for serialization and desalinization of object
What is Transient variable in Java
by serialization mechanism. Serialization mechanism works in the following way... also be brought back to the actual state of bytes using deserialization. Serialization is used in the networking programming where an object must
What happens to the static fields of a class during serialization?
What happens to the static fields of a class during serialization?   What happens to the static fields of a class during serialization?   Hi, Here is the answer, There are three exceptions in which serialization
Java Serialization
Java Serialization In this section, you will learn how to serialize... as Object Serialization. And the recreation of object into the memory from this sequence of byte, is known as Deserialization. Serialized object can be write
Serializable Exception
Serialization is the process of writing an class object that ... Of Serialization 1)Serialization is used in various Java Technologies such as Enterprise... no message. class implements serialization or extending class that also implements
java - Java Interview Questions
java  what is serialization and deserialization?   Hi Friend, The process of transforming an in-memory object to a byte stream is called as Serialization. Deserialization is the inverse process of reconstructing
Java Interview Questions 3
serialization tools that your class is serializable. Question: . How many... interface, you have a complete control over your class's serialization
Java Input/Output Examples
, serialization, and the file system. Here we are giving a long list of examples which
Transient Java Keyword
to learn about serialization in java. Serialization is used to save the state of object by JVM and during deserialization it is recovered. Serialization save...? Transient keyword provide you a control on serialization process in java and allow
Core Java Interview Question, Interview Question
in. Programs that perform serialization and deserialization have to write and read...;     Question: What is serialization ?  Answer: Serialization is the process of writing complete state of java object
Deserializing an Object in java
;  Introduction The opposite operation of the serialization is called deserialization i.e. to extract the data from a series of bytes is s known as deserialization which is also called inflating or unmarshalling
XMLParse
XMLParse       XMLParse does simple deserialization of XML to JavaScript objects like Compatibility Read full Description
Serializing an Object in Java
this example. CLICK HERE TO SEE THE SERIALIZATION & DESERIALIZATION COMPLETE...;    Introduction Serialization is the process... example shows the implementation of serialization to an object. This program takes
Serlization
Serlization  give me real time example of serialization
Serializaiton - Java Interview Questions
Serializaiton  What is Serialization? difference between string and string buffer? what is static?   What is serialization, serialization code in Java and serialization example Java Please visit the following
Core Java Interview Question, Interview Question
are interested in. Programs that perform serialization and deserialization have... is serialization ?  Answer: Serialization is the process of writing complete state
core java
core java  Hi, can any one expain me serialization,Deseralization and exterenalization in core java
Tutorials   
Java Spring Hibernate Struts Training What is the meaning of Java Platform? Why Java is a platform independent language? What is the benefits of learning Core Java? Which technology should I learn after Java? What is array in java with example? How to Convert ArrayList to Array? How to substring in Java? How to format number in Java? What is instance variable in Java? How to download MySQL JDBC driver? What is Calendar class in Java? Which is the best Java tutorials for beginners? How to rename a file in Java? How to delete file in Java code? How to get day from date in Java using Calendar? How to get day of week in Java? How to calculate Date Difference in Java? How to compare date in Java? How to declare array in Java? How to calculate average of array in Java? What is Array in Java? write a java program to find the summation of all the integers entered on command line Sum of two numbers using command line arguments in Java How to create and use Array in Java? How to pass command line arguments in Java? How to create Applet Hello World? Appending String efficiently in Java How to append String in Java? How to list even numbers between 1 and 100? How to add BigDecimal in Java? What is Abstraction In Java? Which is best Beginners Java Tutorial? What is java.util package? Create list from array in Java Filter collection in Java 8 What is the best way to filter a Java Collection? Easy way to transform Collection to Array? How to convert Collection to Array in Java? What are Basic Java Language Elements? Advanced Java Tutorials in 2017 Java brief history Best Reasons to learn Java Java Example Codes and Tutorials in 2017 How do I read a large file quickly in Java? Is learning Java worthwhile? How to create first Java Program? Retrieve database from the table dynamically in jsp from oracle using servlet What does core Java include? java What are some way to learn Java quickly?

Ads

 
Advertisement null

Ads