Java - Online Test - Objects - javasearch.buggybread.com


Share

Search Java Test Questions


 223 test questions in repository.




Java - Test Questions on 'Objects' - 3 questions found


Which of the following do you think is the primary reason you would never use a static class even the application doesn't need multiple requests or threads ?Core Java
Serialization
Runtime Polymorphism
Lazy Loading
Memory

  static class  static vs singleton  java  oops  objects

Which of the following is not type of inner classes ?Core Java
Simple Inner Class
Static Nested Inner Class
Method Nested Static Inner Class
Anonymous Inner Class

  java  classes  inner classes  nested classes

What is the problem with this code ?

public class Car extends Vehicle{   
   int x;
   
   Car(int y){
      x = 5;
   }
   
   Car(){
      this(5);
      super();
   }
}
Core Java
We cannot overload constructors
Constructors should have type
we should have called super() before this(5)
We cannot have both super() and this() in a constructor

  Constructor  this  super







comments powered by Disqus