Exam 3: Using Methods, Classes and Objects

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags
Match each term with the correct statement below.
Premises:
Allocates memory for an object
Responses:
accessor method
formal parameters
mutator method
Correct Answer:
Verified
Premises:
Responses:
Allocates memory for an object
accessor method
Free
(Matching)
4.8/5
(39)
Correct Answer:
Verified

When a variable ceases to exist at the end of a method, programmers say the variable ____.

Free
(Multiple Choice)
4.9/5
(27)
Correct Answer:
Verified

C

A(n)  ____ is a type whose implementation is hidden and accessed through its public methods.

Free
(Multiple Choice)
4.8/5
(34)
Correct Answer:
Verified

B

When a value is returned from a method, you are required to use the value when the method is called.

(True/False)
4.7/5
(24)

A(n) ____ describes the type of data the method sends back to its calling method.

(Multiple Choice)
4.8/5
(32)

A(n) ____ includes the class name, a dot, and the method name.

(Multiple Choice)
4.8/5
(33)

A(n) ____ method is a method that creates and initializes class objects.

(Multiple Choice)
4.8/5
(34)

A(n) ____ is a program module that contains a series of statements that carry out a task.

(Multiple Choice)
4.8/5
(32)

In order to allocate the needed memory for an object, you must use the ____ operator.

(Multiple Choice)
4.9/5
(38)

Assigning ____ to a field means that no other classes can access the field's values.

(Multiple Choice)
4.9/5
(41)

Method names that begin with ____ and set are very typical.

(Multiple Choice)
4.8/5
(37)

public Employee() { empSalary = 300.00; } ​ The above code shows the Employee class constructor. What is a constructor and how would this default constructor operate?

(Essay)
4.8/5
(31)

Data items you use in a call to a method are called ____.

(Multiple Choice)
4.9/5
(35)

How does the order in which methods appear in a class affect how the application executes? Please explain.

(Essay)
4.9/5
(32)
Match each term with the correct statement below.
Premises:
An application or a class that instantiates objects of another prewritten class
Responses:
implementation hiding
static method
extended
Correct Answer:
Verified
Premises:
Responses:
An application or a class that instantiates objects of another prewritten class
implementation hiding
(Matching)
4.8/5
(37)

How do you create an object that is an instance of a class? Provide an example.

(Essay)
4.9/5
(34)

Often, programmers list the ____  first because it is the first method used when an object is created.

(Multiple Choice)
4.8/5
(39)

public int getStudentNum() {    return studentNum; } ​ In the above code, identify if the method is a mutator method or an accessor method. Describe how the two types of methods differ and how they are similar.

(Essay)
4.8/5
(40)
Match each term with the correct statement below.
Premises:
Variables in the method declaration that accept the values from the actual parameters
Responses:
dead code
parameter type
instance variables
Correct Answer:
Verified
Premises:
Responses:
Variables in the method declaration that accept the values from the actual parameters
dead code
(Matching)
4.8/5
(40)
Match each term with the correct statement below.
Premises:
Data components of a class
Responses:
data fields
method's signature
implementation hiding
Correct Answer:
Verified
Premises:
Responses:
Data components of a class
data fields
(Matching)
4.8/5
(48)
Showing 1 - 20 of 79
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)