- Inheritance allows code___________
- Reusability
- Reliability
- Usefulness
- Correctness
- The class that is inherited by the other class is called__________
- Superclass
- Subclass
- Childclass
- None of these
- A java subclass can be defined by using the __________ keyword:
- Public
- Private
- Extends
- None of these
- which inheritance java does not support:
- single
- multiple
- multilevel
- none of these
- In which of the following inheritance a Superclass is inherited by more than one subclass
- Single inheritance
- Multiple inheritance
- Hierarchical inheritance
- Multilevel inheritance
- A member declared as _____can be accessed only within the class :
- Public
- Private
- Protected
- None of these
- The super class constructor can be called within the subclass constructor by using ______ keyword
- super
- sub
- both a & b
- none of these
- Which keyword prevents a method in superclass from being overridden by its subclass :
- Final
- Method
- Class
- None of these
- Which of the following class cannot be inherited:
- Abstract class A
{
:
}
- class B
{
:
}
- final class C
{
:
}
- none of these
- The syntax to define a subclass is:
- Class sub-class extends super_class
- Class subclass extends Superclass
- Class sub_class extends Superclass
- None of these
- Inheritance can be divided into ________ types
- 3
- 4
- 5
- none of these
- Inheritance saves time as well as increase the ______
- Robustness
- Reliability
- Usefulness
- None of these
- The name of the superclass is specified in the________ definition:
- subclass
- Parentclass
- baseclass
- none of these
- Variable declared as ________ cannot be modified
- Private
- Public
- Final
- None of these
- Visibility controls also known as :
- Access
- Modifier
- Access modifier
- None of these
- Superclass in also known as:
- parent class
- base class
- both a & b
- none of these
- Subclass is also known as
- Child class
- Derived class
- Both a& b
- None of these
- How many types of visibility controls in java:
- 2
- 3
- 4
- 6
- Name of the visibility controls:
- public
- private
- protected
- All of these
- One class is inherited from other class which in inherited from some other class:
- Multilevel
- Multiple
- Single
- None of these
- A class inherits properties from more than one Superclass is called_________
- Multiple
- Multilevel
- Single
- Hierarchical
- Which keyword allow overridden in the subclass
- Abstract
- Final
- Class
- None of these
- _______ is the process of creating the logical relationship b\w two or more class:
- Single inheritance
- Inheritance
- Multiple inheritance
- None of these
- Abstract methods must end with semicolon because they _______
- Do not have any functionality
- Have any functionality
- Do not have any methods
- None of these
- Constructors or static methods__________ be declared as abstract:
- cannot
- can
- either be
- none of these
- The syntax for declaring an abstract method is:
- Abstract data _type method_name();
- Abstract data type method_name();
- Abstract data_type method_name():
- Abstract data_type method name();
- A class which cannot be further inherited or cannot have any subclass is known as____________
- Final method
- Final class
- Final variables
- None of these
- The super class provided a_________ structure of the method;
- generalized
- logical
- both a& b
- none of these
- To make abstract class which keyword is used
- Final
- Visibility
- Abstract
- None of these
- Which method is used in abstract class:
- defined
- undefined
- both a& b
- none of these
- If a class is declared as final all of its method are automatically declared as__________:
- Final
- Method
- Class
- None of these
- The syntax for declaring a final class is:
- Final class class_name
{
:
}
- final class class name
{
:
}
c. Final class class name
{
;
}
d. Final class class_name
{
;
}
- _________ is define in the subclass with the name and same signature as in the Superclass:
- Final class
- Final method
- Final variable
- None of these
- Final variable is a __________:
- Zero
- Constant
- One
- None of these
- Super keyword should be the first statement to be executed_______ the subclass constructor:
- Outside
- Inside
- Both a & b
- None of these
- The syntax for declaring a final method is:
- Final data _type method_name()
{ : }
b final data type method name()
{ : }
c Final data _type method name
()
{
: }
d Final data type method name()
{ : }
- The syntax for declaring a final variable:
- Final data _type variable_name=constant_value;
- Final data type variable_name=constant_value;
- Final data _type variable_name=constant value;
- Final data _type variable name=constant_value;
- The syntax for using super keyword is:
- Super (parameter_ list);
- Super (parameter list);
- Super (“parameter_ list”);
- Super (‘parameter_ list’);
- Visible only in the subclass irrespective of packages use__________:
- Public, Protected
- Public, private
- Private, Protected
- None of these
- Visible everywhere in the program use _______ visibility control:
- Protected
- Public
- Private
- None of these
- Invisible everywhere except within the same class use ________ visibility control:
- Private
- Public
- Protected
- None of these
- Visible
everywhere in the same package and subclass in other package use
_________ visibility control:
- Private
- Public
- Protected
- None of these
- Default which is not a ________:
- Public
- Private
- Protected
- All of these
- In java it is not possible is to implement _________ inheritance directly:
- Single
- Multiple
- Multilevel
- Hierarchical
- Multilevel inheritance comprises ________ level
- One
- Two
- Two or more
- None of these
- The subclass has all the properties of its direct super class as well as its indirect super class known as the
- Transitive nature of single inheritance
- Transitive nature of multiple inheritance
- Transitive nature of multilevel inheritance
- Transitive nature of hierarchical inheritance
- The syntax to implement multilevel inheritance is
- Class class1
{
:
}
class class2 extends class1
{
:
}
class class3 extends class2
{
:
}
- Class class1
{
:
}
class class2 extends class1
{
:
}
class class3 extends class1
{
:
}
c. Class class1
{
:
}
class class2 extends class1
{
:
}
class class3 extends class2
{
;
}
d. None of these
- ____________ is the name of subclass that inherits the super class
- Subclass
- Super class
- Inheritance
- None of these
No comments :
Post a Comment