Java Interview Question and Answers Java Serialization,try catch finally block

550 views · Published 21 October 2013 · 3:31 · Indexed 21 October 2026

Channel: Interview DOT · 2013 · Science & Technology

Watch on YouTube

Click here - https://www.youtube.com/channel/UCd0U_xlQxdZynq09knDszXA?sub_confirmation=1 to get notifications. Java Interview Question and Answers Java Serialization,try catch finally block

1. How an object is serialized in java ?

In java, to convert an object into byte stream by serialization, an interface with the name Serializable is implemented by the class. All objects of a class implementing serializable interface get serialized and their state is saved in byte stream.

2. When we should use serialization ?

Serialization is used when data needs to be transmitted over the network. Using serialization, object's state is saved and converted into byte stream .The  byte stream is transferred over the network and the object is re-created at destination.

3. Is it compulsory for a Try Block to be followed by a Catch Block in Java for Exception handling ?

Try block needs to be followed by either Catch block or Finally block or both. Any exception thrown from try block needs to be either caught in the catch block or else any specific tasks to be performed before code abortion are put in the Finally block.

One Click Dream Job http://www.interviewdot.com/upload-resume/uploadresume.htm

Free Interview Books Download http://www.interviewdot.com/main-page-left-links-pages/getmycareer-download-resumes.htm


Other Top Job Portals
www.naukri.com
www.monsterindia.com
www.timesjobs.com
www.freshersworld.com

More from this channel