stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
inheritance Flashcards | StudBud
Explore
/
inheritance
Super keyword in java is used to
What is subclass in java?
inheritance
24 terms
·
StudBud Administration
·
10 plays
10/31/2019 day32 java
Flashcards
24 cards
F
Practice quiz
P
Host live
L
Questions
24
Answers
1
What is subclass in java?
A subclass is a class declared inside a class
A subclass is a class that extends another class
it is keyword in java
Parent class is called sub class
2
Super keyword in java is used to
Refer to immediate child class instance variables
Refer immediate parent class instance variables
When class variable has the same name as your local variable
Hide implementation details
3
we can access parent class variables in child class by using super keyword
True
False
4
How to invoke parent class’s variable from child class, when variable names of both parent & child class are same
using this keyword
using super keyword
using extends keyword
using variable name
5
In which java oops feature one object can acquire all the properties and behaviors of the parent object?
Method Overriding
Method Overloading
Inheritance
Encapsulation
6
True statement about extending a class in java is
A class can extends only one Parent class
A class can have multiple Parent classes.
None
A class cannot extend another class
7
Super keyword in java is used to ____
refer parent class object
refer sub class object
refer to sub-class and parent class objects
when class variable and local variable has same name
8
False statement about static method in java
Belongs to class not object of the class
Can access non static variables directly without creating object
All are correct
Can be called without any object creation of a class
9
Following concept can be used for encapsulation in java programs
Method overriding
Parent-child relation using extends keyword
Hiding data and internal methods using access modifiers in a class
Method overloading
10
Which of these keyword can be used in subclass to call the constructor of superclass?
extends keywords
this keyword
super()
class name
11
We CANNOT call parent class constructor in sub class constructor by using super keyword
True
False
12
Runtime polymorphism feature in java is
method overloading
Encapsulation
Java Array's
method overriding
13
Which of these is correct way of calling a constructor having no parameters, of superclass A by subclass B?
super.A();
super(void);
super();
superclass.();
14
Which keyword is used to refer current object of a class in Java?
this
new
array
new
15
Java object oriented programming concepts is/are
Polymorphism
All of the above
Inheritance
Encapsulation
16
If you want to write multiple methods in a class with same name, then what Java feature will you use?
Super keyword
Encapsulation
Method overloading
Method overriding
17
For Cat and Animal class, correct way of inheritance in java is
None is correct way
class Cat extends Animal
class Animal extends Cat
Both are correct way
18
IS-A relationship in java is related to
Abstraction
Encapsulation
Inheritance
Polymorphism
19
Java does not support _______________?
Inheritance
Multiple inheritance for classes
Encapsulation
Single Inheritance
20
where can we use super() in constructor
we cannot use super() in constructor
super() anywhere inside constructor body
super() must be first statement in constructor body
super() should be used in constructor parameter
21
In java, “
this
” keyword is used to
when class variable and local variable has same name
Method overriding concept
when parent class and child class has same method name
Method overloading concept
22
what is the order of execution of constructors in Java Inheritance?
Parent class constructor executes only
Child class constructor executed first then parent class
parent class constructor executed first then child class
child class constructor executes only
23
What is the process of defining a method in subclass having same name & type signature as a method in its superclass?
Method overloading
super keyword
Method overriding
Method hiding
24
How to invoke parent class method from child class, if method is overridden in the child class ?
using extends keyword
using super keyword
creating parent class object
using this keyword