Exam 3: Using Methods Classes and Objects

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Which of the following is NOT an initial value assigned to an object's data field by a default constructor?

(Multiple Choice)
4.9/5
(37)

An application's main() method must have a void return type.

(True/False)
4.9/5
(42)

Access specifiers are sometimes called access ____________________.

(Short Answer)
4.8/5
(39)
Match each term with the correct statement below.
Data components of a class
formal parameters
Variables you declare within a class, but outside of any method
method's signature
Used to return a value back to the calling method
instance variables
Correct Answer:
Verified
Premises:
Responses:
Data components of a class
formal parameters
Variables you declare within a class, but outside of any method
method's signature
Used to return a value back to the calling method
instance variables
Are called class methods
return statement
Included within the method declaration parentheses
parameter type
The first line of a method
class user
An application or a class that instantiates objects of another prewritten class
header
Variables in the method declaration that accept the values from the actual parameters
data fields
The combination of the method name and the number, types, and order of arguments
static method
(Matching)
4.9/5
(40)

Methods that retrieve values are called ____ methods.

(Multiple Choice)
4.8/5
(37)

What are the two parts of every method? Describe them.

(Essay)
4.8/5
(40)

When creating a method that requires multiple parameters, why would a programmer need to understand a method's signature, and why must a method call match the called method's signature?

(Essay)
4.8/5
(31)

You can identify a class that is an application because it contains a public static void main() method.

(True/False)
4.7/5
(36)

The interface is the part of a method that the method's client does not see.

(True/False)
5.0/5
(33)

A method body provides information about how other methods can interact with it.

(True/False)
4.7/5
(52)

Describe what a public access class is and when you would use one. 

(Essay)
4.9/5
(38)

   Identify and describe the four components that make up the method header above. Identify and describe the four components that make up the method header above.

(Essay)
4.7/5
(47)

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

(True/False)
4.8/5
(35)

A unique identifier is most likely used as a ____ key in a database.

(Multiple Choice)
4.8/5
(38)

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

(Multiple Choice)
4.8/5
(41)

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

(Multiple Choice)
4.7/5
(40)

What are the possible results if arguments to a method are passed in the wrong order?

(Essay)
5.0/5
(42)

public class Employee { private int empNum; private double empSalary; public void setEmpNum(int emp) { empNum = emp; }  public void setEmpSalary(double sal) { empSalary = sal; } } Given the class defined in the code above, write the Java statements that will create a new employee instance called employee15 and assign an empNum of 15 and empSalary of 500.00 to that employee instance.

(Essay)
4.8/5
(45)

____ is a principle of object-oriented programming that describes the encapsulation of method details within a class.

(Multiple Choice)
5.0/5
(41)

A method's identifier must be more than one word, must have embedded spaces, and can be a Java keyword.

(True/False)
4.8/5
(36)
Showing 21 - 40 of 66
close modal

Filters

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