Deck 11: Classes Continued

ملء الشاشة (f)
exit full mode
سؤال
If a class implements an interface, all its subclasses do so implicitly.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Characteristics common to several classes can be collected in a common abstract subclass. ____________________
سؤال
A class variable belongs to an object and is allocated storage when the object is created.
سؤال
Interfaces can be organized in an inheritance hierarchy.
سؤال
Classes that are related by inheritance have a has-a relationship. ____________________
سؤال
When you declare a variable, it should have a different interface name from the type name.
سؤال
An abstract class is one that will not be instantiated. ____________________
سؤال
Class methods can reference only instance variables, never static variables.
سؤال
It is easier to maintain a program that uses interface types.
سؤال
A Java ____ specifies the set of methods available to clients of a class.

A) interface
B) alias
C) variable
D) exception
سؤال
The methods in an interface are usually private. ____________________
سؤال
____ is when methods in different classes with a similar function are given the same name.

A) Aliasing
B) Inheritance
C) Polymorphism
D) Referencing
سؤال
The value of a class constant is assigned ____.

A) during execution
B) based on user input
C) based on inheritance
D) when the variable is declared
سؤال
A class can implement methods in addition to those listed in the interface.
سؤال
An interface is a class.
سؤال
A subclass often has methods that do not appear in its superclass.
سؤال
A class method is activated when a message is sent to the class rather than the object. ____________________
سؤال
____ provides a mechanism for reusing code and can reduce the effort required to implement a new class.

A) Aliasing
B) Inheritance
C) Polymorphism
D) Referencing
سؤال
In general, a static variable is used in any situation in which all instances share a common data value.
سؤال
In the TurtleGraphics package, the pen is initially all of the following EXCEPT ____.

A) at position [0,0]
B) ready to draw a square
C) pointing north
D) in the down position
سؤال
To compare objects for equality, use the ____.

A) = = operator
B) equals method
C) compare operator
D) both a and b are true.
سؤال
The class immediately above another is called its ____.

A) superclass
B) subclass
C) descendent
D) root
سؤال
The most general type of array is one whose element type is ____.

A) String
B) Object
C) Shape
D) Int
سؤال
____ a variable to a type that conflicts with its true identity leads to a run-time error.

A) Defining
B) Assigning
C) Declaring
D) Casting
سؤال
In Java, all classes are part of an immense hierarchy, with the class ____________________ at the root.
سؤال
A(n) ____________________ class is one that will be instantiated.
سؤال
FIGURE 11-1 <strong>FIGURE 11-1   Alec suggests that Amara create documentation for her program by embedding comments using the ____ symbol.</strong> A) < B) @ C) { D) /** <div style=padding-top: 35px>
Alec suggests that Amara create documentation for her program by embedding comments using the ____ symbol.

A) <
B) @
C) {
D) /**
سؤال
A(n) ____ method is accessible to a class's descendents, but not to any other classes in the hierarchy.

A) protected
B) private
C) dependent
D) inherited
سؤال
FIGURE 11-1 <strong>FIGURE 11-1   In Figure 11-1 above, we say that AAA ____ Object.</strong> A) aliases B) extends C) aggregates D) overrides <div style=padding-top: 35px>
In Figure 11-1 above, we say that AAA ____ Object.

A) aliases
B) extends
C) aggregates
D) overrides
سؤال
When information needs to be shared among all instances of a class, that information can be represented in terms of ____________________ variables.
سؤال
When the element type of an array is a(n) ____ or interface, objects of those types or any subtype can be directly inserted into the array.

A) primitive
B) concrete
C) abstract
D) reference
سؤال
A class's ____ provides the information needed to use the class without revealing anything about its implementation..

A) value
B) definition
C) interface
D) hierarchy
سؤال
One way to enforce preconditions is to ____.

A) use comments
B) declare them
C) use inheritance
D) throw an exception
سؤال
The relationship that allows an object of one class to send a message to an object of another class is called ____.

A) inheritance
B) superclass
C) dependency
D) aggregation
سؤال
A(n) ____________________ method cannot be overridden by a subclass.
سؤال
Methods in a subclass can be related to methods in a superclass in all of the following ways EXCEPT ____.

A) implementation of a concrete method.
B) extension
C) overriding
D) finality
سؤال
FIGURE 11-1 <strong>FIGURE 11-1   Figure 11-1 above shows an example of a ____ hierarchy.</strong> A) class B) interface C) program D) method <div style=padding-top: 35px>
Figure 11-1 above shows an example of a ____ hierarchy.

A) class
B) interface
C) program
D) method
سؤال
The ____ process uses the clone message to obtain copies.

A) duplication
B) deep copying
C) aliasing
D) overriding
سؤال
When related classes have the same ____, they can be used interchangeably in a program.

A) value
B) definition
C) interface
D) hierarchy
سؤال
If more than one class implements an interface, its methods are ____.

A) aggregated
B) public
C) dependent
D) polymorphic
سؤال
Identify the letter of the choice that best matches the phrase or definition.
a.Dependency
b.Extension
c.Overriding
d.Aggregation
e.Inheritance
When an object of one class contains objects of another class as structural components.
سؤال
A method's ____________________ describe what should be true before it is called.
سؤال
Identify the letter of the choice that best matches the phrase or definition.
a.Dependency
b.Extension
c.Overriding
d.Aggregation
e.Inheritance
When objects are related by sending and receiving a message.
سؤال
Identify the letter of the choice that best matches the phrase or definition.
a.Dependency
b.Extension
c.Overriding
d.Aggregation
e.Inheritance
When the subclass method does not exist in the superclass.
سؤال
Identify the letter of the choice that best matches the phrase or definition.
a.Dependency
b.Extension
c.Overriding
d.Aggregation
e.Inheritance
When the subclass method is intended as a replacement of the superclass method.
سؤال
Identify the letter of the choice that best matches the phrase or definition.
a.Dependency
b.Extension
c.Overriding
d.Aggregation
e.Inheritance
When an object's class is a subclass of a more general class.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/46
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 11: Classes Continued
1
If a class implements an interface, all its subclasses do so implicitly.
True
2
Characteristics common to several classes can be collected in a common abstract subclass. ____________________
False
3
A class variable belongs to an object and is allocated storage when the object is created.
False
4
Interfaces can be organized in an inheritance hierarchy.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
5
Classes that are related by inheritance have a has-a relationship. ____________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
6
When you declare a variable, it should have a different interface name from the type name.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
7
An abstract class is one that will not be instantiated. ____________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
8
Class methods can reference only instance variables, never static variables.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
9
It is easier to maintain a program that uses interface types.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
10
A Java ____ specifies the set of methods available to clients of a class.

A) interface
B) alias
C) variable
D) exception
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
11
The methods in an interface are usually private. ____________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
12
____ is when methods in different classes with a similar function are given the same name.

A) Aliasing
B) Inheritance
C) Polymorphism
D) Referencing
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
13
The value of a class constant is assigned ____.

A) during execution
B) based on user input
C) based on inheritance
D) when the variable is declared
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
14
A class can implement methods in addition to those listed in the interface.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
15
An interface is a class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
16
A subclass often has methods that do not appear in its superclass.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
17
A class method is activated when a message is sent to the class rather than the object. ____________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
18
____ provides a mechanism for reusing code and can reduce the effort required to implement a new class.

A) Aliasing
B) Inheritance
C) Polymorphism
D) Referencing
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
19
In general, a static variable is used in any situation in which all instances share a common data value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
20
In the TurtleGraphics package, the pen is initially all of the following EXCEPT ____.

A) at position [0,0]
B) ready to draw a square
C) pointing north
D) in the down position
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
21
To compare objects for equality, use the ____.

A) = = operator
B) equals method
C) compare operator
D) both a and b are true.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
22
The class immediately above another is called its ____.

A) superclass
B) subclass
C) descendent
D) root
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
23
The most general type of array is one whose element type is ____.

A) String
B) Object
C) Shape
D) Int
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
24
____ a variable to a type that conflicts with its true identity leads to a run-time error.

A) Defining
B) Assigning
C) Declaring
D) Casting
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
25
In Java, all classes are part of an immense hierarchy, with the class ____________________ at the root.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
26
A(n) ____________________ class is one that will be instantiated.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
27
FIGURE 11-1 <strong>FIGURE 11-1   Alec suggests that Amara create documentation for her program by embedding comments using the ____ symbol.</strong> A) < B) @ C) { D) /**
Alec suggests that Amara create documentation for her program by embedding comments using the ____ symbol.

A) <
B) @
C) {
D) /**
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
28
A(n) ____ method is accessible to a class's descendents, but not to any other classes in the hierarchy.

A) protected
B) private
C) dependent
D) inherited
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
29
FIGURE 11-1 <strong>FIGURE 11-1   In Figure 11-1 above, we say that AAA ____ Object.</strong> A) aliases B) extends C) aggregates D) overrides
In Figure 11-1 above, we say that AAA ____ Object.

A) aliases
B) extends
C) aggregates
D) overrides
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
30
When information needs to be shared among all instances of a class, that information can be represented in terms of ____________________ variables.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
31
When the element type of an array is a(n) ____ or interface, objects of those types or any subtype can be directly inserted into the array.

A) primitive
B) concrete
C) abstract
D) reference
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
32
A class's ____ provides the information needed to use the class without revealing anything about its implementation..

A) value
B) definition
C) interface
D) hierarchy
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
33
One way to enforce preconditions is to ____.

A) use comments
B) declare them
C) use inheritance
D) throw an exception
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
34
The relationship that allows an object of one class to send a message to an object of another class is called ____.

A) inheritance
B) superclass
C) dependency
D) aggregation
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
35
A(n) ____________________ method cannot be overridden by a subclass.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
36
Methods in a subclass can be related to methods in a superclass in all of the following ways EXCEPT ____.

A) implementation of a concrete method.
B) extension
C) overriding
D) finality
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
37
FIGURE 11-1 <strong>FIGURE 11-1   Figure 11-1 above shows an example of a ____ hierarchy.</strong> A) class B) interface C) program D) method
Figure 11-1 above shows an example of a ____ hierarchy.

A) class
B) interface
C) program
D) method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
38
The ____ process uses the clone message to obtain copies.

A) duplication
B) deep copying
C) aliasing
D) overriding
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
39
When related classes have the same ____, they can be used interchangeably in a program.

A) value
B) definition
C) interface
D) hierarchy
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
40
If more than one class implements an interface, its methods are ____.

A) aggregated
B) public
C) dependent
D) polymorphic
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
41
Identify the letter of the choice that best matches the phrase or definition.
a.Dependency
b.Extension
c.Overriding
d.Aggregation
e.Inheritance
When an object of one class contains objects of another class as structural components.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
42
A method's ____________________ describe what should be true before it is called.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
43
Identify the letter of the choice that best matches the phrase or definition.
a.Dependency
b.Extension
c.Overriding
d.Aggregation
e.Inheritance
When objects are related by sending and receiving a message.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
44
Identify the letter of the choice that best matches the phrase or definition.
a.Dependency
b.Extension
c.Overriding
d.Aggregation
e.Inheritance
When the subclass method does not exist in the superclass.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
45
Identify the letter of the choice that best matches the phrase or definition.
a.Dependency
b.Extension
c.Overriding
d.Aggregation
e.Inheritance
When the subclass method is intended as a replacement of the superclass method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
46
Identify the letter of the choice that best matches the phrase or definition.
a.Dependency
b.Extension
c.Overriding
d.Aggregation
e.Inheritance
When an object's class is a subclass of a more general class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 46 في هذه المجموعة.