Select chapter



basics (7.papers)
constructors (1.papers)
packages (1.papers)
inheritance (7.papers)
misc (3.papers)
exceptions (5.papers)
threads (4.papers)
overloading (1.papers)
jsp (3.papers)
servlets (9.papers)
jdbc (2.papers)
util (1.papers)
xml (2.papers)
IO stream (3.papers)
Hide

Sponsored Links


  

java interview questions and answers

1
Which of the following method(s) must a class implementing Serializable define?
  1. serialize()
  2. writeObject()
  3. readObject()
  4. It does not need to implement any method
Show Answer
Share Facebook gmail Twitter
2
What is the exception thrown by read() method of InputStream class?
  1. Exception
  2. FileNotFoundException
  3. ReadException
  4. IOException
Show Answer
Share Facebook gmail Twitter
3
FileReader fr = new FileReader("fr.dat"); 
This statement throws 
  1.  IOException
  2. FileNotFoundException
  3. FileNotAvailableException
  4. NullPointerException
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
5
Which of the following is true about java.lang.Object class?
  1. It implements Serializable 
  2. It is a final class
  3. A class implementing Serializable must mark its fields of Object type as transient
  4. A  class implementing Serializable cannot have Object instance 
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
9
In Java, is a stream bi-directional?
  1. No, a stream is unidirectional. It can either read or write depending on its type.
  2. No, streams work  only for writing 
  3. Yes, streams are bi-directional and same stream can read and write.
  4. Yes, streams are bi-directional with a restriction a write stream must be flushed before next read 
Show Answer
Share Facebook gmail Twitter
10
System.out is an instance of
  1. FileWriter
  2. DataOutputStream
  3. PrintStream 
  4. ObjectOutputStream
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
12
Java Serialization uses 
  1. Character stream
  2. Byte Stream
  3. depends on OS
  4. depends on JVM implementation
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Read more papers :