Deck 9: Object-Oriented Programming: Classes and Objects
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/80
العب
ملء الشاشة (f)
Deck 9: Object-Oriented Programming: Classes and Objects
1
A ReadOnly property provides only a __________ accessor.
A)Set
B)Read
C)Get
D)Const
A)Set
B)Read
C)Get
D)Const
C
2
A constructor call is required for every object that's created.
True
3
Private class members are accessible only from outside the class in which they're declared.
False
4
A(n)___________ is a special type of method that is used only when an object is created to initialize an object's data.
A)initializer
B)builder
C)constructor
D)definer
A)initializer
B)builder
C)constructor
D)definer
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
5
A class can be used to create an instance of the class called a(n)________.
A)child
B)part
C)offspring
D)object
A)child
B)part
C)offspring
D)object
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
6
Which of the following is a built-in reference type?
A)Integer
B)String
C)Boolean
D)Char
A)Integer
B)String
C)Boolean
D)Char
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
7
A Throw statement immediately returns its __________ argument to the caller.
A)class
B)exception
C)object
D)method
A)class
B)exception
C)object
D)method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
8
Visual Basic is known as a(n)__________ language because you can declare new class types as needed.
A)modifiable
B)growable
C)extensible
D)high-level
A)modifiable
B)growable
C)extensible
D)high-level
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
9
Instance variables declared with Dim default to __________ access.
A)Private
B)Public
C)Class
D)Member
A)Private
B)Public
C)Class
D)Member
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
10
How many classes are there in a program/app?
A)0
B)1
C)more than 1
D)The number of classes may vary.
A)0
B)1
C)more than 1
D)The number of classes may vary.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
11
The compiler provides a default constructor with __________ parameter(s)in any class that does not explicitly declare a constructor.
A)0
B)1
C)2
D)any number of
A)0
B)1
C)2
D)any number of
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
12
Object orientation uses classes primarily to:
A)develop algorithms
B)house data (attributes)and methods
C)organize large amounts of data
D)None of the above.
A)develop algorithms
B)house data (attributes)and methods
C)organize large amounts of data
D)None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
13
A car has many __________,such as its color,the number of doors,the amount of gas in its tank,its current speed and its odometer reading.
A)methods
B)messages
C)attributes
D)clients
A)methods
B)messages
C)attributes
D)clients
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
14
You can provide a parameterless constructor that contains code and takes no parameters,or that takes only Optional parameters so you can call it with no arguments.
A)Required
B)Optional
C)Voluntary
D)Class
A)Required
B)Optional
C)Voluntary
D)Class
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
15
Public class members are accessible wherever the program has a reference to an object of the class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
16
What is the default value of a reference?
A)0
B)Nil
C)Nothing
D)Null
A)0
B)Nil
C)Nothing
D)Null
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
17
An object-creation expression creates a new object of the class specified to the right of New and calls the object's constructor.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
18
Constructors cannot be overloaded.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
19
Each class you create becomes a new type that can be used to declare variables and create objects.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
20
A variable of a reference type contains:
A)information about the type and its data
B)data of that type
C)the address of the location in memory where data is stored
D)None of the above.
A)information about the type and its data
B)data of that type
C)the address of the location in memory where data is stored
D)None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
21
Which statements successfully swap the contents of an array at index 3 and index 4?
A) values( 3 )= values( 4 )
Values( 4 )= values( 3 )
B) values( 4 )= values( 3 )
Values( 3 )= values( 4 )
C) Dim temp As Integer = values( 3 )
Values( 3 )= values( 4 )
Values( 4 )= temp;
D) Dim temp As Integer = values( 3 )
Values( 3 )= values( 4 )
Values( 4 )= values( 3 )
A) values( 3 )= values( 4 )
Values( 4 )= values( 3 )
B) values( 4 )= values( 3 )
Values( 3 )= values( 4 )
C) Dim temp As Integer = values( 3 )
Values( 3 )= values( 4 )
Values( 4 )= temp;
D) Dim temp As Integer = values( 3 )
Values( 3 )= values( 4 )
Values( 4 )= values( 3 )
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
22
Primitive-type variables refer to objects in a Visual Basic app.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
23
If a variable is said to have block scope then that variable:
A)can be accessed by all methods
B)can be accessed only by certain methods
C)can be accessed only by the method in which it was defined
D)None of the above
A)can be accessed by all methods
B)can be accessed only by certain methods
C)can be accessed only by the method in which it was defined
D)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
24
Constructors are implemented as Sub methods because they cannot return values.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
25
A constructor method is invoked each time an object of the class is instantiated.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
26
Variables declared within class methods are called instance variables.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
27
Which function is called when another class's object is used where a String should be?
A)TranslateToString
B)String
C)ConvertToString
D)ToString
A)TranslateToString
B)String
C)ConvertToString
D)ToString
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
28
Value types normally represent single pieces of data.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
29
A primitive-type variable can store exactly one value at a time,whereas one object can contain many individual pieces of data.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
30
Within a class's scope,class members are immediately accessible only to certain methods of that class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
31
A constructor should return either True or False to determine if the object was initialized properly.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
32
Which of the following is the correct syntax for accessing the Public property Tire of an object named myCar outside of the Car class?
A)myCar(Tire)
B)myCar.Tire
C)myCar ->Tire
D)None of the above
A)myCar(Tire)
B)myCar.Tire
C)myCar ->Tire
D)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
33
The _________ of a class are also called the public services or the public interface that the class provides to its clients.
A)public constructors
B)public instance variables
C)public methods
D)All of the above
A)public constructors
B)public instance variables
C)public methods
D)All of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
34
A class's initializes instance variables of that class.
A)constructor
B)utility method
C)access modifier
D)None of the above.
A)constructor
B)utility method
C)access modifier
D)None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
35
You can create new reference types.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
36
You should not take into consideration that your code will be modified.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
37
The keyword _______ indicates that the method overrides an existing method with the same signature.
A)Replaces
B)Overrides
C)Overrules
D)Supersedes
A)Replaces
B)Overrides
C)Overrules
D)Supersedes
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
38
Every class inherits directly or indirectly from class _________ except for itself.
A)Inheritor
B)Base
C)VB
D)Object
A)Inheritor
B)Base
C)VB
D)Object
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
39
The purpose of utility methods is to support the operation of a class's other methods.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
40
Instance variables or methods declared with the modifier are accessible only in that class definition.
A)Protected
B)Shared
C)Private
D)None of the above.
A)Protected
B)Shared
C)Private
D)None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
41
Programmers are encouraged to use method-parameter names that that are the same as instance variable names.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
42
Which of the following describes a Shared variable?
A)a variable with one copy shared by all class objects
B)a variable whose value may not be changed
C)all of the above
D)None of the above.
A)a variable with one copy shared by all class objects
B)a variable whose value may not be changed
C)all of the above
D)None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
43
Which of the following usages of the Me reference is syntactically correct (assume mHour is an instance variable of class CTime and the current object is an instance of CTime)?
A)Me.mHour
B)Me(CTime.mHour)
C)Me(CTime).mHour
D)None of the above.
A)Me.mHour
B)Me(CTime.mHour)
C)Me(CTime).mHour
D)None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
44
For properties that do not have any additional logic in their Set and Get accessors,__________ properties allow you to write one line of code and have the compiler generate the property's instance variable and accessors.
A)automatic
B)auto-implemented
C)auto-coded
D)None of the above
A)automatic
B)auto-implemented
C)auto-coded
D)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
45
The Me reference is used implicitly to refer to the instance variables,properties and methods of an object.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
46
Shared class variables have:
A)global scope
B)class scope
C)method scope
D)All of the above
A)global scope
B)class scope
C)method scope
D)All of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
47
Only certain objects have a Me reference.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
48
While shadowing,programmers could use the This keyword and the dot separator to access the instance variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
49
Object initializers (which initialize an object and its properties)use what keyword?
A)Includes
B)Defined
C)With
D)Construct
A)Includes
B)Defined
C)With
D)Construct
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
50
Outside a class's scope,class members cannot be referenced directly by name.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
51
Failure to release resources when the program is no longer using them can cause .
A)buffer overflows
B)resource leaks
C)exceptions
D)None of the above.
A)buffer overflows
B)resource leaks
C)exceptions
D)None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
52
Outside a class' scope,Public members can be accessed only by using the dot (. )operator.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
53
An object's Me reference refers to:
A)the object itself
B)what the programmer specified
C)the entry point of the program
D)None of the above.
A)the object itself
B)what the programmer specified
C)the entry point of the program
D)None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
54
Me can be used to distinguish between a local variable and an instance variable that share the same name.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
55
When the number of references to an object becomes ,that object is marked for garbage collection.
A)low
B)zero
C)one
D)None of the above
A)low
B)zero
C)one
D)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
56
Having a Me reference allows:
A)A method to refer explicitly to the instance variables and other methods of the object on which the method was called.
B)A method to refer implicitly to the instance variables and other methods of the object on which the method was called.
C)An object to reference itself.
D)All of the above.
A)A method to refer explicitly to the instance variables and other methods of the object on which the method was called.
B)A method to refer implicitly to the instance variables and other methods of the object on which the method was called.
C)An object to reference itself.
D)All of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
57
An object initializer calls the default constructor before executing.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
58
Select the syntactically correct way to access a Public Shared class member.
A)className(sharedMemberName)
B)sharedMemberName.className
C)className.sharedMemberName
D)sharedMemberName(className)
A)className(sharedMemberName)
B)sharedMemberName.className
C)className.sharedMemberName
D)sharedMemberName(className)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
59
If you write the code Public Property Hour As Integer,the compiler would generate property code that would use the Private instance variable __________.
A)Hour
B)Hour_
C)_Hour_
D)_Hour
A)Hour
B)Hour_
C)_Hour_
D)_Hour
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
60
In a method in which a parameter has the same name as an instance variable,the expression Me.name will refer to ________.
A)the parameter
B)the instance variable
C)varies depending on the situation
D)None of the above
A)the parameter
B)the instance variable
C)varies depending on the situation
D)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
61
A Shared variable represents method-wide information.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
62
Attempting to modify the value of a Const variable at run time is a syntax error.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
63
Shared class members are available only after the first object of that class is created
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
64
To access a Private Shared class member when no objects of the class exist,a Public Shared method or property must be provided.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
65
Const members can be initialized only to other constant values.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
66
Each object of a class has its own copy of all the instance variables of the class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
67
The Object Brower _____________.
A)lists all the classes in the .NET library
B)describes the functionality provided by each specific class
C)is separated into three frames
D)All of the above.
A)lists all the classes in the .NET library
B)describes the functionality provided by each specific class
C)is separated into three frames
D)All of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
68
Data members declared as ReadOnly must be initialized in their declaration.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
69
A program contains a copy of a Shared variable for each object that is instantiated.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
70
Which of the following is not a keyword used to declare a constant variable:
A)Const
B)ReadOnly
C)NamedConst
D)None of the above
A)Const
B)ReadOnly
C)NamedConst
D)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
71
Class Math provides only methods that perform common mathematical calculations.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
72
A Shared method has a Me reference.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
73
Constructors that are Shared can be defined to initialize only Shared members.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
74
A Shared method may access Shared and non-Shared members.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
75
All Math class methods are Shared and are therefore called by preceding the name of the method with the class name Math and a __________ separator.
A):
B),
C))
D)/
A):
B),
C))
D)/
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
76
Keyword is used for constants whose values cannot be determined at compile time.
A)Const
B)ReadOnly
C)Shared
D)None of the above.
A)Const
B)ReadOnly
C)Shared
D)None of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
77
Const members must be initialized at compile time,but ReadOnly values are not initialized until runtime.Neither one can be modified once initialized.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
78
Variables that are Shared have class scope.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
79
You use the Object Browser to learn about the functionality provided by a specific class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck
80
Const members are not implicitly Shared.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 80 في هذه المجموعة.
فتح الحزمة
k this deck