Question 11 When should a program explicitly use the this reference? A. Accessin
ID: 3758265 • Letter: Q
Question
Question 11
When should a program explicitly use the this reference?
A. Accessing a private variable
B. Accessing a public variable
C. Accessing a local variable
D. Accessing a field that is shadowed by a local variable
Question 12
Composition is sometimes referred to as a(n) __________ relationship.
A. is-a
B. has-a
C. have-a
D. one-to-many
Question 13
How many parameters does the default constructor that C# creates for you have?
A. 3
B. 1
C. 0
D. Varies
Question 14
A class’s __________ initializes members of that class.
A. constructor
B. utility method
C. access modifier
D. None of the above.
Question 15
In a method in which a parameter has the same name as an instance variable, using the this reference allows you to refer to:
A. the parameter.
B. the instance variable.
C. It varies depending on the situation.
D. None of the above
Question 16
Stacks are commonly referred to as __________ data structures.
A. first-in, last-out
B. first-in, first-out
C. last-in, first-out
D. None of the above
Question 17
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
Question 18
Which of the following is FALSE?
A. A static method or property must be used to access private static instance variables.
B. A static method has no this reference.
C. A static method can be accessed even when no objects of its class have been instantiated.
D. A static method can call instance methods directly.
Question 19
Which of the following describes a static 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
Question 20
Abstract Data Types:
A. elevate the importance of data.
B. are approximations or models of real-world concepts and behaviors.
C. capture two notions—data representation and operations.
D. All of the above
Explanation / Answer
Question 11
When should a program explicitly use the this reference?
A. Accessing a private variable
B. Accessing a public variable
C. Accessing a local variable
D. Accessing a field that is shadowed by a local variable
Ans: D. Accessing a field that is shadowed by a local variable
Question 12
Composition is sometimes referred to as a(n) __________ relationship.
A. is-a
B. has-a
C. have-a
D. one-to-many
Ans: b. has-a
Question 13
How many parameters does the default constructor that C# creates for you have?
A. 3
B. 1
C. 0
D. Varies
Ans :c.0
Question 14
A class’s __________ initializes members of that class.
A. constructor
B. utility method
C. access modifier
D. None of the above.
Ans: A. Constructor
Question 15
In a method in which a parameter has the same name as an instance variable, using the this reference allows you to refer to:
A. the parameter.
B. the instance variable.
C. It varies depending on the situation.
D. None of the above
Ans: B. the instance variable.
Question 16
Stacks are commonly referred to as __________ data structures.
A. first-in, last-out
B. first-in, first-out
C. last-in, first-out
D. None of the above
Ans : C. last-in, first-out
Question 17
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
Ans: B. resource leaks.
Question 18
Which of the following is FALSE?
A. A static method or property must be used to access private static instance variables.
B. A static method has no this reference.
C. A static method can be accessed even when no objects of its class have been instantiated.
D. A static method can call instance methods directly.
Ans: D. A static method can call instance methods directly.
Question 19
Which of the following describes a static 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
Ans: A. A variable with one copy shared by all class objects
Question 20
Abstract Data Types:
A. elevate the importance of data.
B. are approximations or models of real-world concepts and behaviors.
C. capture two notions—data representation and operations.
D. All of the above
Ans: D. All of the above
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.