Question

(T or F) The reserved word throw is used to signal that an exception has occurred....

  1. (T or F) The reserved word throw is used to signal that an exception has occurred.
  2. (T or F) The correct use of throw can be anywhere in a program; a try / catch structure is used only in class definitions.
  3. (T or F) In C++, class is not a reserved word.
  4. (T or F) Class attributes have no fixed type; their type can be changed during the program execution.
  5. (T or F) A member of a class can be a method or an attribute.
  6. (T or F)The private attributes of a class cannot be accessed by the public methods of that class.
  7. (T or F) The initialization of a variable in the declaration

Ex: int counter = 0;

is not allowed inside a class definition.

  1. (T or F) In C++ a class is a definition; it does not exist in RAM until an object is created, using the definition.
  2. (T or F) 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.
  3. (T or F) Class objects can be passed to methods as arguments and can be returned from methods.
  4. (T or F) A class constructor is a method that automatically is called whenever an object is created from the class.
  5. (T or F) a class destructor is another name for a no-arg constructor..
  6. (T or F) a class cannot have more than one constructo
  7. (T or F) a class can have a destructor to match each constructor.
  8. (T or F) 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.
  9. (T or F) Every time any method is called, a new “frame” is created in RAM.
    1. (T or F) A “pure” class definition can contain only methods.
    1. (T or F) A class definition by itself, takes very little space in RAM. PLEASE ANSWER ALLLLLL!!!!!!!!!!!!!!!!!!!!!!!!!!!

Homework Answers

Answer #1

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

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
QUESTION 1: This question is also to be used for the next question. Design an Employee...
QUESTION 1: This question is also to be used for the next question. Design an Employee class for a hotel for use in programs. We need an Employee object with these attributes: Name Designation (ex. Manager, Supervisor, Waiter, Bellhop, etc.) ID number Some details: ID Numbers should already be known at time of object's creation. Assume it is an 8 digit number. The ID Number can never be changed Use strings to represent the Name and Designation It is possible...
A stack can be used to print numbers in other bases (multi-base output). Examples: (Base8) 2810...
A stack can be used to print numbers in other bases (multi-base output). Examples: (Base8) 2810 = 3 * 81 + 4 * 80 = 348 (Base4) 7210 = 1 * 43 + 0 * 42 + 2 * 41 + 0 * 4 = 10204 (Base 2) 5310 = 1 * 25 + 1*24 + 0 * 23 + 1 * 22 + 0 * 21 + 1 * 20 = 1101012 Write a java program using stacks that...
C# Step 1: Create a Windows Forms Application. Step 2: Create a BankAccount class. Include: Private...
C# Step 1: Create a Windows Forms Application. Step 2: Create a BankAccount class. Include: Private data fields to store the account holder's name and the account balance A constructor with 0 arguments A constructor with 1 argument (account holder's name) A constructor with 2 arguments(account holder's name and account balance) Public properties for the account holder's name and the account balance. Do not use auto-implemented properties. A method to increase the balance (deposit) A method to decrease the balance...
3.2 Class Dictionary This class implements a dictionary using a hash table in which collisions are...
3.2 Class Dictionary This class implements a dictionary using a hash table in which collisions are resolved using separate chaining. The hash table will store objects of the class Data. You will decide on the size of the table, keeping in mind that the size of the table must be a prime number. A table of size between 5000-10000, should work well. You must design your hash function so that it produces few collisions. A bad hash function that induces...
JAVA please Arrays are a very powerful data structure with which you must become very familiar....
JAVA please Arrays are a very powerful data structure with which you must become very familiar. Arrays hold more than one object. The objects must be of the same type. If the array is an integer array then all the objects in the array must be integers. The object in the array is associated with an integer index which can be used to locate the object. The first object of the array has index 0. There are many problems where...
Code in Java SAMPLE PROGRAM OUTPUT Because there are several different things your program might do...
Code in Java SAMPLE PROGRAM OUTPUT Because there are several different things your program might do depending upon what the user enters, please refer to the examples below to use to test your program. Run your final program one time for each scenario to make sure that you get the expected output. Be sure to format the output of your program so that it follows what is included in the examples. Remember, in all examples bold items are entered by...
This laboratory assignment involves implementing a data structure called a map. A map associates objects called...
This laboratory assignment involves implementing a data structure called a map. A map associates objects called keys with other objects called values. It is implemented as a Java class that uses arrays internally. 1. Theory. A map is a set of key-value pairs. Each key is said to be associated with its corresponding value, so there is at most one pair in the set with a given key. You can perform the following operations on maps. You can test if...
Java question, Please answer everything. Thank you Answer the following questions as briefly (but completely) as...
Java question, Please answer everything. Thank you Answer the following questions as briefly (but completely) as possible: What is a checked exception, and what is an unchecked exception? What is NullPointerException? Which of the following statements (if any) will throw an exception? If no exception is thrown, what is the output? 1: System.out.println( 1 / 0 ); 2: System.out.println( 1.0 / 0 ); Point out the problem in the following code. Does the code throw any exceptions? 1: long value...
this is the book name. Data Structures and Abstractions with Java 1) Description: The sample programs...
this is the book name. Data Structures and Abstractions with Java 1) Description: The sample programs in Chapter 1 of your textbook are not complete. They are used for illustration purpose only. The implementation of Listing 1-1 on page 39 is explained in Chapter 2. And, in order to see the result of using it, we will need the following set of files: i. BagInteface.java – the specification only. ii. ArrayBag.java – the implementation of BagInerface.java. iii. ArrayBagDemo.java – a...