ISDS 505 Final Ch 9 (A+ Guaranteed.)
An object is a(n) ________________________ of a class. a. instantiation b. institution c. child d. relative correct answers a. instantiation A class header or class definition can contain all of the following except ________________________. a. an optional access modifier b. the keyword class c. an identifier d. initial field values correct answers d. initial field values Most fields in a class are created with the ________________________ modifier. a. public b. private c. new d. protected correct answers b. private Most methods in a class are created with the ________________________ modifier. a. public b. private c. new d. protected correct answers a. public Instance methods that belong to individual objects are ________________________ static methods. a. always b. usually c. occasionally d. never correct answers d. never To allocate memory for an object instantiation, you must use the ________________________ operator. a. mem b. alloc c. instant d. new correct answers d. new Assume that you have created a class named MyClass. The header of the MyClass constructor can be ________________________. a. public void MyClass() b. public MyClassConstructor() c. Either of these can be the constructor header. d. Neither of these can be the constructor header. correct answers d. Neither of these can be the constructor header.
Información del documento
- Subido en
- 5 de abril de 2024
- Número de páginas
- 3
- Escrito en
- 2023/2024
- Tipo
- Examen
- Contiene
- Preguntas y respuestas