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

Show Answer
Share Facebook gmail Twitter
2
Which of the below class definitions holds correct for an abstract class?
  1. class Vehicle { abstract void run(); }
  2. abstract Vehicle { abstract void run(); }
  3. class abstract Vehicle { abstract void run(); }
  4. abstract class Vehicle { abstract void run(); }
Show Answer
Share Facebook gmail Twitter
3
A class Vehicle has a subclass Bicycle. Which of the below statements are true?
  1. Bicycle can have no subclasses.  
  2.  Bicycle can have no other parent class than Vehicle.  
  3. Vehicle class can have only one subclass.  
  4. Bicycle does not inherit from Object class
Show Answer
Share Facebook gmail Twitter
4
Which is NOT an advantage of inheritance in java?
  1. Code that is shared between classes needs to be written only once.  
  2. Similar classes can be made to behave consistently.  
  3. Enhancements to a base class will automatically be applied to derived classes.  
  4. One big superclass can be used instead of many little classes.  
Show Answer
Share Facebook gmail Twitter
5
Which of the following is FALSE about "this"and"super" keywords?
  1. Both this and super keywords cannot be used inside a static method
  2. this() and super() can be called from an instance method
  3. super(); should be the first statement of a constructor  
  4. this();   should be the first statement of a constructor
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
Select the  inheritance that Java does not support.
  1. Multi-level inheritance  
  2. Single inheritance  
  3. Multiple inheritance  
Show Answer
Share Facebook gmail Twitter
10
Which of the below is not an Object class method?
  1. equals()
  2. println()
  3. finalize()
  4. toString()
Show Answer
Share Facebook gmail Twitter
11
What is true about overloading and overriding?
  1. A method can be both overloaded and overridden
  2. A method can not be both overloaded and overridden
  3. Method overloading can be done in the base class only
  4. Overriding can be done both in base and derived class
Show Answer
Share Facebook gmail Twitter
12
Which is true in the context of overloading?
  1. Overloaded methods MUST change the argument list.
  2. Overloaded methods MUST change the return type.
  3. Overloaded methods MUST change the access modifier.
  4. Overloaded methods are also overridden methods
Show Answer
Share Facebook gmail Twitter
13
Which of the following statements are true?
  1. Has-a relationship always rely on inheritance.
  2. Has-a relationships always rely on instance variables.
  3. Has-a relationships always require at least two class types.
  4. Has-a relationships always rely on polymorphism
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 :