Question 1 Object initializers (which initialize an object and its properties) u
ID: 3758264 • Letter: Q
Question
Question 1
Object initializers (which initialize an object and its properties) use what syntax?
A. new className ( property1 -> value1 , … );
B. new className ( property1 = value1 , … );
C. new className { property1 = value1 , … };
D. className { property1 = value1 , … };
Question 2
The __________ of a class are also called the public services or the public interface of the class.
A. public constructors
B. public instance variables
C. public methods
D. All of the above
Question 3
An instance of a user-defined type is called a(n):
A. class.
B. interface.
C. object.
D. None of the above
Question 4
Object orientation uses classes to:
A. develop algorithms.
B. encapsulate data and methods.
C. organize large amounts of data.
D. None of the above
Question 5
The use of references to objects of preexisting classes as members of new objects is called:
A. inheritance.
B. composition.
C. polymorphism.
D. None of the above
Question 6
A __________ data structure can be described as a "waiting line."
A. stack
B. queue
C. list
D. None of the above
Question 7
A constructor CANNOT:
A. be overloaded.
B. initialize variables to their defaults.
C. specify return types or return values.
D. have the same name as the class.
Question 8
Every class inherits directly or indirectly from class:
A. Inheritor.
B. Base.
C. Super.
D. object.
Question 9
Which statement is FALSE?
A. The compiler always creates a default constructor for a class.
B. If a class has constructors, but none of the public constructors are parameterless, and a program attempts to call a parameterless constructor to initialize an object of the class, a compilation error occurs.
C. A constructor can be called with no arguments only if the class does not have any constructors or if the class has a public parameterless constructor.
D. Parameterless constructors do not have any arguments.
Question 10
An object’s this reference refers to:
A. the object itself.
B. what the programmer specified.
C. the entry point of the program.
D. None of the above
Explanation / Answer
1.Object initializers (which initialize an object and its properties) use what syntax?
Answer: new className ( property1 = value1 , … );
2. The __________ of a class are also called the public services or the public interface of the class.
Answer: public instance variables
3. An instance of a user-defined type is called a(n):
Answer: object.
4. Object orientation uses classes to: encapsulate data and methods, develop algorithms and organize large amounts of data.
5.The use of references to objects of preexisting classes as members of new objects is called: composition.
6.A queue data structure can be described as a "waiting line."
7. A constructor CANNOT: specify return types or return values.
8. Every class inherits directly or indirectly from class: object.
9. Which statement is FALSE?
Answer: The compiler always creates a default constructor for a class.
10.An object’s this reference refers to: the object itself.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.