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


Share

Search Java Test Questions


 223 test questions in repository.




Java - Test Questions on 'classes' - 8 questions found


Which of the following can be marked static ?Core Java
Methods , Variables and Initialization Blocks.
Methods , Variables , Initialization Blocks and Outer Classes and nested Classes.
Methods , Variables , Initialization Blocks and Outer Classes.
Methods , Variables , Initialization Blocks and nested Classes.

  oops  java  static  nested classes  static nested classes

Which of the following cannot be marked static ?Core Java
Constructors , Classes ( Outer ) , Classes ( nested ), Interfaces , Local variables , Inner Class methods and instance variables.
Constructors , Classes ( Outer ) , Interfaces , Local variables , Class variables , Class Methods , Inner Class methods and instance variables.
Constructors , Classes ( Outer ) , Interfaces , Local variables , Inner Class methods and instance variables.
Constructors , Classes ( Outer ) , Classes (Nested), Interfaces , Local variables , Inner Class methods and instance variables.

  oops  java  static  nested classes  static nested classes

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

Which of following can be nested into another ?Core Java
class within another class
class within interface
interface within class
All of above

  nested classes   nested interface  inner classes

An Ideal Util class doesn't have ...Core Java
private constructor
static methods
static variables
non static methods

  Util classes

Which of the following class cannot be extended or inherited ?

StringBuffer , StringBuilder
Core Java
StringBuffer
StringBuilder
Both cannot be extended
Both can be extended

  final classes  StringBuffer  StringBuilder

If X implements Y and Y extends Z, Which of the following initialization is correct ?Core Java
X x = new Y();
X x = new Z();
Z z = new Y();
Z z = new X();

  interfaces

If class A implements X interface, and Class B implements Y interface, and X is the parent of Y, Which of the following initialization is correct ?Core Java
A a = new B();
Y y = new A();
X x = new B();
Y y = new A();

  interfaces   inheritance







comments powered by Disqus