Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. A class in java is like a. b. c. d. a variable an object an instantiation of

ID: 3856612 • Letter: 1

Question

1. A class in java is like a. b. c. d. a variable an object an instantiation of an object a blueprint for creating objects 2. The signature of a method consists of the following a. b. c. d. Return type, method name and types of input parameters Method name and types of input parameters Method name, types of input parameters and their order Return type, method name, types of input parameters and their order 3. The following is true with respect to a static variable a. b. c. d. It can be modified by only one object Each object gets a unique copy of the static variable Only one copy exists - no matter how many objects are instantiated Cannot be modified by non-static method 4. The get and set methods in a class are also known, respectively, as a. b. c. d. accessor and mutator methods mutator and accessor methods accessor and constructor methods mutator and constructor methods. 5. If a class is named Student, what name can you use for a constructor for this class? a. Student b. Student.java c. void Student d. any name can be used since the constructor can be overloaded 6. When defining a constructor, what do you specify for the type of value returned? a. Primitive data type such as int b. Class name such as Student c. void d. Constructor does not have an explicit return type

Explanation / Answer

1. A class in java is like

a. a variable

b. an object

c. instantiation of an object

d. a blueprint for creating objects

Answer:a blueprint for creating objects

Option:D

2. The signature of a method consists of the following

a. Return type, method name and types of input parameters

b. Method name and types of input parameters

c. Method name, types of input parameters and their order

d. Return type, method name, types of input parameters and their order

Answer:Return type, method name, types of input parameters and their order

Option : D

3. The following is true with respect to a static variable

a. It can be modified by only one object

b. Each object gets a unique copy of the static variable

c. Only one copy exists - no matter how many objects are instantiated

d. Cannot be modified by non-static method

Answer: Cannot be modified by non-static method

Option:D

4.The get and set methods in a class are also known, respectively, as

a. accessor and mutator methods

b. mutator and accessor methods

c. accessor and constructor methods

d. mutator and constructor methods.

Answer: Accessor and Mutator methods

Option :A

5. If a class is named Student, what name can you use for a constructor for this class?

a. Student

b. Student.java

c. void Student

d. any name can be used since the constructor can be overloaded

Answer:Student

Option: A

6. When defining a constructor, what do you specify for the type of value returned?

a. Primitive data type such as int

b. Class name such as Student

c. void

d. Constructor does not have an explicit return type

Answer:Constructor does not have an explixit return type

Option :D