Deck 7: Inheritance

ملء الشاشة (f)
exit full mode
سؤال
A base class is synonymous with a:
(a)Child class
(b)Parent class
(c)Derived class
(d)Sub class
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
If an instance variable is not modified by public,protected or private then it is said to have:
(a)Package access
(b)Default access
(c)Friendly access
(d)All of the above
سؤال
The special syntax for invoking a constructor of the base class is:
(a)super()
(b)base()
(c)parent()
(d)child()
سؤال
A super class is also called a
(a)derived class
(b)dominant class
(c)sub class
(d)base class
سؤال
When you define a derived class,you give only the added instance variables and the added methods as well as all the methods from the base class.
سؤال
What does a derived class automatically inherit from the base class?
(a)instance variables
(b)static variables
(c)public methods
(d)all of the above
سؤال
Inheritance refers to a very specialized form of a class.
سؤال
A method or instance variable modified by protected:
(a)can not be accessed by name inside its own class definitions.
(b)can not be accessed by name inside any class derived from it.
(c)can not be accessed by name in the definition of any class in the same package.
(d)can not be accessed by name in any other class (that is,other than classes named in a-c.).
سؤال
The keyword extends indicates:
(a)encapsulation
(b)polymorphism
(c)inheritance
(d)none of the above
سؤال
The equals method for a class should have _________ as the type of its one parameter.
(a)String
(b)Object
(c)Integer
(d)Double
سؤال
In using the keyword this in place of super(),the invocation of this must be the ___________ action taken by the constructor.
(a)first
(b)last
(c)it does not matter
(d)none of the above
سؤال
The Object class contains the method:
(a)getClass()
(b)toString()
(c)equals()
(d)all of the above
سؤال
A derived class contains only public instance variables and public methods from the base class.
سؤال
The class __________ is an ancestor class of all Java classes.
(a)String
(b)Object
(c)Math
(d)JFrame
سؤال
If the final modifier is added to the definition of a method,this means:
(a)The method may be redefined in the derived class.
(b)The method may be redefined in the sub class.
(c)The method may not be redefined in the derived class.
(d)None of the above.
سؤال
Inheritance is the process by which a new class - known as a _________ - is created from another class,called the _____________.
(a)base class,derived class
(b)derived class,base class
(c)inherited class,base class
(d)base class,inherited class
سؤال
A derived class is also called a
(a)sub class
(b)super class
(c)base class
(d)all of the above
سؤال
An object of a derived class has the type of the derived class,and it also has the type of the base class,and more generally,has the type of every one of its ___________ classes.
(a)descendant
(b)child
(c)ancestor
(d)sub
سؤال
Inheritance promotes code ___________.
(a)reinvention
(b)reuse
(c)repeats
(d)all of the above
سؤال
A derived class is a class defined by adding instance variables and methods to an existing class.
سؤال
Write Java statements that compares Objects,O1 and O2,using the getClass()method.
سؤال
The call to the base class constructor (super)must always be the last action taken in a constructor definition.
سؤال
Explain what a call to super()does in a constructor of a derived class.
سؤال
What is encapsulation?
سؤال
The keyword extends indicates polymorphism.
سؤال
Explain the difference between method overloading and method overriding.
سؤال
What does the instanceof operator do?
سؤال
Create a test driver to test the functionality of your AlarmClock class created in number 3 above.
سؤال
Explain the modifiers public,protected and private.
سؤال
Define a derived class to represent an alarm clock.Use the Clock class,created in number 2 above,as your base class.
سؤال
What is an "is a" relationship? How does it apply to the world of objects?
سؤال
An instance variable (or method)that is private in a base class is accessible by name in the definition of a method in any other class.
سؤال
What is package access?
سؤال
You may substitute the keyword this for super()to call a constructor of the derived class.
سؤال
What is a "has a" relationship?
سؤال
Private methods of the base class are not available for use by derived classes.
سؤال
Overriding is when a derived class redefines a method from the base class.
سؤال
A constructor for a derived class begins with an invocation of a constructor for the base class.
سؤال
Define a base class to represent a Clock.Your class should have instance variables for hours,minutes and seconds.
سؤال
Explain how parent and child classes are related to base and derived classes.
سؤال
Create a test driver to test the functionality of your Rectangle class created in number 14 above.
سؤال
What are the different ways in which you can check the class of an Object?
سؤال
Create a class to represent a Rectangle.Your class should contain instance variables for length and width,as well as member method to calculate the area and perimeter.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/43
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 7: Inheritance
1
A base class is synonymous with a:
(a)Child class
(b)Parent class
(c)Derived class
(d)Sub class
B
2
If an instance variable is not modified by public,protected or private then it is said to have:
(a)Package access
(b)Default access
(c)Friendly access
(d)All of the above
D
3
The special syntax for invoking a constructor of the base class is:
(a)super()
(b)base()
(c)parent()
(d)child()
A
4
A super class is also called a
(a)derived class
(b)dominant class
(c)sub class
(d)base class
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
5
When you define a derived class,you give only the added instance variables and the added methods as well as all the methods from the base class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
6
What does a derived class automatically inherit from the base class?
(a)instance variables
(b)static variables
(c)public methods
(d)all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
7
Inheritance refers to a very specialized form of a class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
8
A method or instance variable modified by protected:
(a)can not be accessed by name inside its own class definitions.
(b)can not be accessed by name inside any class derived from it.
(c)can not be accessed by name in the definition of any class in the same package.
(d)can not be accessed by name in any other class (that is,other than classes named in a-c.).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
9
The keyword extends indicates:
(a)encapsulation
(b)polymorphism
(c)inheritance
(d)none of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
10
The equals method for a class should have _________ as the type of its one parameter.
(a)String
(b)Object
(c)Integer
(d)Double
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
11
In using the keyword this in place of super(),the invocation of this must be the ___________ action taken by the constructor.
(a)first
(b)last
(c)it does not matter
(d)none of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
12
The Object class contains the method:
(a)getClass()
(b)toString()
(c)equals()
(d)all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
13
A derived class contains only public instance variables and public methods from the base class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
14
The class __________ is an ancestor class of all Java classes.
(a)String
(b)Object
(c)Math
(d)JFrame
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
15
If the final modifier is added to the definition of a method,this means:
(a)The method may be redefined in the derived class.
(b)The method may be redefined in the sub class.
(c)The method may not be redefined in the derived class.
(d)None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
16
Inheritance is the process by which a new class - known as a _________ - is created from another class,called the _____________.
(a)base class,derived class
(b)derived class,base class
(c)inherited class,base class
(d)base class,inherited class
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
17
A derived class is also called a
(a)sub class
(b)super class
(c)base class
(d)all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
18
An object of a derived class has the type of the derived class,and it also has the type of the base class,and more generally,has the type of every one of its ___________ classes.
(a)descendant
(b)child
(c)ancestor
(d)sub
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
19
Inheritance promotes code ___________.
(a)reinvention
(b)reuse
(c)repeats
(d)all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
20
A derived class is a class defined by adding instance variables and methods to an existing class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
21
Write Java statements that compares Objects,O1 and O2,using the getClass()method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
22
The call to the base class constructor (super)must always be the last action taken in a constructor definition.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
23
Explain what a call to super()does in a constructor of a derived class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
24
What is encapsulation?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
25
The keyword extends indicates polymorphism.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
26
Explain the difference between method overloading and method overriding.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
27
What does the instanceof operator do?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
28
Create a test driver to test the functionality of your AlarmClock class created in number 3 above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
29
Explain the modifiers public,protected and private.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
30
Define a derived class to represent an alarm clock.Use the Clock class,created in number 2 above,as your base class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
31
What is an "is a" relationship? How does it apply to the world of objects?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
32
An instance variable (or method)that is private in a base class is accessible by name in the definition of a method in any other class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
33
What is package access?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
34
You may substitute the keyword this for super()to call a constructor of the derived class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
35
What is a "has a" relationship?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
36
Private methods of the base class are not available for use by derived classes.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
37
Overriding is when a derived class redefines a method from the base class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
38
A constructor for a derived class begins with an invocation of a constructor for the base class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
39
Define a base class to represent a Clock.Your class should have instance variables for hours,minutes and seconds.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
40
Explain how parent and child classes are related to base and derived classes.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
41
Create a test driver to test the functionality of your Rectangle class created in number 14 above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
42
What are the different ways in which you can check the class of an Object?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
43
Create a class to represent a Rectangle.Your class should contain instance variables for length and width,as well as member method to calculate the area and perimeter.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.