Which is the Best Java Web Framework ?

Java - Interview Questions and Answers on Serialization

Q1.  What is Serialization ?

Ans. Storing the state of an object in a file or other medium is called serialization.

Q2.  Can we serialize static variables ?

Ans. No. Only Object and its members are serialized. Static variables are shared variables and doesn't correspond to a specific object. 

Q3.  What are transient variables in java?

Ans. Transient variables are variable that cannot be serialized.

Q4.  What one should take care of, while serializing the object?

Ans. One should make sure that all the included objects are also serializable. If any of the objects is not serializable then it throws a NotSerializable Exception.

Q5.  Difference between Serialization and Deserialization ?

Ans. Serialization is the process of writing the state of an object to a byte stream. Deserialization is the process of restoring these objects.

Q6.  What are Marker Interfaces ? Name few Java marker interfaces ?

Ans. These are the interfaces which have no declared methods.

Serializable and cloneable are marker interfaces.

Q7.  What is an Externalizable interface ?

Ans. Externalizable interface is used to write the state of an object into a byte stream in compressed format.

Q8.  Difference between serializable and externalizable interface ?

Ans. Serializable is a marker interface whereas externalizable  is not.

Q1. Name classes that implement Serializable interface?

Ans.

[ SyncFailedException,  XMLSignatureException,  ProtocolException,  JMException, AclNotFoundException,  ParserConfigurationException, FileNotFoundException,  GeneralSecurityException,  JMXProviderException,  ActivationException,  UnknownServiceException,  MimeTypeParseException,  ExpandVetoException,  UserPrincipalNotFoundException,  ClosedChannelException,  GSSException,  TooManyListenersException,  LastOwnerException,  DataFormatException,  UnsupportedLookAndFeelException, Boolean, IllegalArgumentException,  PrintException,  PropertyVetoException,  SOAPException,  UnsupportedAudioFileException,  PrivilegedActionException,  MalformedURLException,  UnsupportedFlavorException,  InterruptedByTimeoutException,  RefreshFailedException,  UserException,  CharacterCodingException,  AWTException,  UnsupportedCallbackException,  NamingException,  XMLStreamException,  CharConversionException,  NotOwnerException,  NoninvertibleTransformException,  SSLException,  TransformerException,  SaslException,  RemoteException,  JMXServerErrorException,  InvalidMidiDataException,  BadBinaryOpValueExpException,  EOFException,  FileNotFoundException,  SocketException,  NotBoundException, IOException,  ReflectiveOperationException,  PrinterException,  BackingStoreException,  InterruptedException,  FontFormatException,  RuntimeException,  XPathException,  DatatypeConfigurationException,  BadLocationException,  IOException,  XAException,  HttpRetryException,  InvalidPreferencesFormatException,  SQLException,  CertificateException,  ServerNotActiveException,  BadStringOperationException,  UTFDataFormatException,  IllegalClassFormatException,  TransformException,  DestroyFailedException,  AlreadyBoundException,  InterruptedIOException,  UnmodifiableClassException,  IntrospectionException,  UnknownHostException,  IIOException,  BrokenBarrierException,  ObjectStreamException,  InvalidTargetObjectTypeException,  ApplicationException,  URISyntaxException,  XMLParseException, Throwable,  InvalidApplicationException,  UnsupportedDataTypeException, File,  RemarshalException,  URIReferenceException,  FilerException,  JAXBException,  UnsupportedEncodingException,  SAXException,  BadAttributeValueExpException,  CloneNotSupportedException,  ExecutionException,  KeySelectorException,  TimeoutException, ChangedCharSetException, Error,  ParseException,  MidiUnavailableException,  ZipException,  LineUnavailableException, Exception,  ScriptException,  FileSystemException,  FileLockInterruptionException,  InvalidPropertiesFormatException,  MarshalException]


Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner
comments powered by Disqus




×

Try our new Java Interview Questions Search Tool.

There are more than 1000 questions with practice tests.

It's updated daily and It's Awesome.


×

Try our new Java Practice Test tool.

There are more than 200 questions and expanding quickly. It's updated daily and It's Awesome.