Ex: int counter = 0;
is not allowed inside a class definition.
1 - The reserved word throw is used to signal that an exception has occurred. - TRUE
2 - The correct use of throw can be anywhere in a program; a try / catch structure is used only in class definitions. - FALSE
3 - In C++, class is not a reserved word. - FALSE
4 - Class attributes have no fixed type; their type can be changed during the program execution. - TRUE
5 - A member of a class can be a method or an attribute. - TRUE
6 - The private attributes of a class cannot be accessed by the public methods of that class. - FALSE
7 - The initialization of a variable in the declaration, Ex: int counter = 0; is not allowed inside a class definition. - FALSE
8 - In C++ a class is a definition; it does not exist in RAM until an object is created, using the definition - TRUE
9 - A member of a class that was created “on the stack” (locally) can be accessed by using the dot operator (.) followed by the member name. - TRUE
10 - Class objects can be passed to methods as arguments and can be returned from methods. - TRUE
11 - A class constructor is a method that automatically is called whenever an object is created from the class.- TRUE
12 - a class destructor is another name for a no-arg constructor..- FALSE
13 - a class cannot have more than one constructor - FALSE
14 - a class can have a destructor to match each constructor. - TRUE
15 - The primary purpose of the separation of a class interface from the class implementation enables the code to be more easily read by a human programmer. - TRUE
16 - Every time any method is called, a new “frame” is created in RAM. - TRUE
17 - A “pure” class definition can contain only methods. - FALSE
18 - A class definition by itself, takes very little space in RAM - FALSE
Get Answers For Free
Most questions answered within 1 hours.