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/









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 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? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? neo4j-server.properties file location SASLError using PLAIN: not-authorized

Ads

 
Advertisement null

Ads