Deck 3: Using Methods Classes and Objects

Full screen (f)
exit full mode
Question
____ is a principle of object-oriented programming that describes the encapsulation of method details within a class.

A) An interface
B) A calling method
C) Implementation hiding
D) Instantiation
Use Space or
up arrow
down arrow
to flip the card.
Question
Application classes frequently instantiate objects that use the objects of other classes.
Question
Parentheses in a method declaration contain parameters that are "dropped into" the method.
Question
The arguments in a method call are often referred to as ____.

A) constants
B) concept parameters
C) actual parameters
D) argument lists
Question
You can write your own constructor methods; but when you don't write a constructor method for a class object, Java writes one for you.
Question
A method body provides information about how other methods can interact with it.
Question
A method header is also called a(n) _____.

A) argument
B) address
C) statement
D) declaration
Question
A method's identifier must be more than one word, must have embedded spaces, and can be a Java keyword.
Question
Any class can contain an unlimited number of methods.
Question
An application's main() method must have a void return type.
Question
A(n) ____ causes a value to be sent from a called method back to the calling method.

A) return statement
B) method statement
C) instantiation
D) inheritance relationship
Question
The ____ method executes first in an application, regardless of where you physically place it within its class.

A) start()
B) run()
C) main()
D) execute()
Question
When a value is returned from a method, you are required to use the value when the method is called.
Question
A(n) ____ is a program module that contains a series of statements that carry out a task.

A) argument
B) method
C) application
D) declaration
Question
A(n) ____ variable is known only within the boundaries of the method.

A) method
B) local
C) double
D) instance
Question
When a variable ceases to exist at the end of a method, programmers say the variable ____.

A) is undeclared
B) is out of memory range
C) goes out of scope
D) is lost
Question
You can identify a class that is an application because it contains a public static void main() method.
Question
The interface is the part of a method that the method's client does not see.
Question
Every object is a _____ of a more general class.

A) constant
B) member
C) method
D) field
Question
Data items you use in a call to a method are called ____.

A) arguments
B) instance variables
C) method declarations
D) headers
Question
The name of the ____ is always the same as the name of the class whose objects it constructs.

A) method
B) constructor
C) argument
D) variable
Question
A unique identifier is most likely used as a ____ key in a database.

A) special
B) public
C) static
D) primary
Question
A(n) ____ constructor is one that requires no arguments.

A) class
B) default
C) explicit
D) write
Question
Public classes are accessible by all objects, which means that public classes can be ____, or used as a basis for any other class.

A) saved
B) extended
C) copied
D) used
Question
Normally, you declare constructors to be ____________________ so that other classes can instantiate objects that belong to the class.
Question
Often, programmers list the ____________________ first because it is the first method used when an object is created.
Question
Access specifiers are sometimes called access ____________________.
Question
In order to allocate the needed memory for an object, you must use the ____ operator.

A) new
B) main
C) type
D) return
Question
A(n) ____________________ data type is a type whose implementation is hidden and accessed through its public methods.
Question
Method names that begin with ____ and set are very typical.

A) next
B) call
C) read
D) get
Question
For ease in locating class methods, many programmers store them in ____ order.

A) chronological
B) type
C) alphabetical
D) numeric
Question
When an application is run, the method that must be executed first must be named ____.

A) first()
B) void()
C) main()
D) final()
Question
A(n) ____ method is a method that creates and initializes class objects.

A) constructor
B) accessor
C) non-static
D) instance
Question
After an object has been instantiated, its methods can be accessed using the object's _____, a dot, and a method call.

A) identifier
B) class
C) operator
D) output
Question
Assigning ____ to a field means that no other classes can access the field's values.

A) user rights
B) protected access
C) key access
D) private access
Question
Methods used with object instantiations are called ____ methods.

A) accessor
B) internal
C) static
D) instance
Question
To execute a method, you ____________________ it from another method.
Question
Which of the following is NOT an initial value assigned to an object's data field by a default constructor?

A) numeric fields set to 0
B) Boolean fields set to true
C) character fields set to Unicode '\u0000'
D) a field of object references set to null
Question
____ parameters are variables in a method declaration that accept the values from the actual parameters.

A) System
B) Formal
C) Public
D) Static
Question
Methods that retrieve values are called ____ methods.

A) static
B) accessor
C) class
D) mutator
Question
Match between columns
Data components of a class
header
Data components of a class
method's signature
Data components of a class
parameter type
Data components of a class
static method
Data components of a class
formal parameters
Data components of a class
return statement
Data components of a class
instance variables
Data components of a class
class user
Data components of a class
data fields
Variables you declare within a class, but outside of any method
header
Variables you declare within a class, but outside of any method
method's signature
Variables you declare within a class, but outside of any method
parameter type
Variables you declare within a class, but outside of any method
static method
Variables you declare within a class, but outside of any method
formal parameters
Variables you declare within a class, but outside of any method
return statement
Variables you declare within a class, but outside of any method
instance variables
Variables you declare within a class, but outside of any method
class user
Variables you declare within a class, but outside of any method
data fields
Used to return a value back to the calling method
header
Used to return a value back to the calling method
method's signature
Used to return a value back to the calling method
parameter type
Used to return a value back to the calling method
static method
Used to return a value back to the calling method
formal parameters
Used to return a value back to the calling method
return statement
Used to return a value back to the calling method
instance variables
Used to return a value back to the calling method
class user
Used to return a value back to the calling method
data fields
Are called class methods
header
Are called class methods
method's signature
Are called class methods
parameter type
Are called class methods
static method
Are called class methods
formal parameters
Are called class methods
return statement
Are called class methods
instance variables
Are called class methods
class user
Are called class methods
data fields
Included within the method declaration parentheses
header
Included within the method declaration parentheses
method's signature
Included within the method declaration parentheses
parameter type
Included within the method declaration parentheses
static method
Included within the method declaration parentheses
formal parameters
Included within the method declaration parentheses
return statement
Included within the method declaration parentheses
instance variables
Included within the method declaration parentheses
class user
Included within the method declaration parentheses
data fields
The first line of a method
header
The first line of a method
method's signature
The first line of a method
parameter type
The first line of a method
static method
The first line of a method
formal parameters
The first line of a method
return statement
The first line of a method
instance variables
The first line of a method
class user
The first line of a method
data fields
An application or a class that instantiates objects of another prewritten class
header
An application or a class that instantiates objects of another prewritten class
method's signature
An application or a class that instantiates objects of another prewritten class
parameter type
An application or a class that instantiates objects of another prewritten class
static method
An application or a class that instantiates objects of another prewritten class
formal parameters
An application or a class that instantiates objects of another prewritten class
return statement
An application or a class that instantiates objects of another prewritten class
instance variables
An application or a class that instantiates objects of another prewritten class
class user
An application or a class that instantiates objects of another prewritten class
data fields
Variables in the method declaration that accept the values from the actual parameters
header
Variables in the method declaration that accept the values from the actual parameters
method's signature
Variables in the method declaration that accept the values from the actual parameters
parameter type
Variables in the method declaration that accept the values from the actual parameters
static method
Variables in the method declaration that accept the values from the actual parameters
formal parameters
Variables in the method declaration that accept the values from the actual parameters
return statement
Variables in the method declaration that accept the values from the actual parameters
instance variables
Variables in the method declaration that accept the values from the actual parameters
class user
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
header
The combination of the method name and the number, types, and order of arguments
method's signature
The combination of the method name and the number, types, and order of arguments
parameter type
The combination of the method name and the number, types, and order of arguments
static method
The combination of the method name and the number, types, and order of arguments
formal parameters
The combination of the method name and the number, types, and order of arguments
return statement
The combination of the method name and the number, types, and order of arguments
instance variables
The combination of the method name and the number, types, and order of arguments
class user
The combination of the method name and the number, types, and order of arguments
data fields
Question
A major advantage of a method is that it is easily reusable. What does it mean to reuse a method and what are the advantages of doing so?
Question
What are the two parts of every method? Describe them.
Question
Does a programmer need to write every class he or she uses? Why or why not?
Question
What are the four components of a method header?
Question
Write a valid class header with public access. Assign a valid identifier of your choice. Then write the body of the class that contains one data field named myPractice with a data type of double . Be sure to include any necessary curly braces and semicolons.
Question
How do you use a value returned from a method? Provide an example.
Question
  Identify and describe the four components that make up the method header above.<div style=padding-top: 35px>
Identify and describe the four components that make up the method header above.
Question
public Employee()
{
empSalary = 300.00;
}
The above code shows the Employee class constructor. What is a constructor and how would this default constructor operate?
Question
Explain the purpose of a return type of a method. Describe the return value of a method that returns no data.
Question
How do you create an object that is an instance of a class? Provide an example.
Question
What is a method and how is one used?
Question
How does the order in which methods appear in a class affect how the application executes? Please explain.
Question
public static void predictRaise(double salary)
{
double newSalary;
final double RAISE_RATE = 1.10;
newSalary = salary * RAISE_RATE;
System.out.println("Current salary: " +
salary + " After raise: " +
newSalary);
}
In the above code, what are the parameter data type and parameter identifier? How do you identify each?
Question
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?
Question
What are the possible results if arguments to a method are passed in the wrong order?
Question
Describe instantiation and how it relates to 'is-a relationships.'
Question
Describe how you can use multiple arguments in a method. Provide an example.
Question
Describe what a public access class is and when you would use one. 
Question
What is the difference between a mutator method and an accessor method? Provide an example of each.
Question
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.
Question
  In the above code, the calculateBonus() method acts as a black box. What does this mean?<div style=padding-top: 35px> In the above code, the calculateBonus() method acts as a "black box." What does this mean?
Question
  Fill in the blank line in the above code to add a statement that calls a method named practiceWithCalls that passes a parameter named testing of type double.<div style=padding-top: 35px>
Fill in the blank line in the above code to add a statement that calls a method named practiceWithCalls that passes a parameter named testing of type double.
Question
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.
Question
Describe fully qualified identifiers and explain why they are necessary.
Question
  In the above code, what would happen if the arguments passed to the method were passed in the wrong order?<div style=padding-top: 35px> In the above code, what would happen if the arguments passed to the method were passed in the wrong order?
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/66
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 3: Using Methods Classes and Objects
1
____ is a principle of object-oriented programming that describes the encapsulation of method details within a class.

A) An interface
B) A calling method
C) Implementation hiding
D) Instantiation
C
2
Application classes frequently instantiate objects that use the objects of other classes.
True
3
Parentheses in a method declaration contain parameters that are "dropped into" the method.
True
4
The arguments in a method call are often referred to as ____.

A) constants
B) concept parameters
C) actual parameters
D) argument lists
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
5
You can write your own constructor methods; but when you don't write a constructor method for a class object, Java writes one for you.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
6
A method body provides information about how other methods can interact with it.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
7
A method header is also called a(n) _____.

A) argument
B) address
C) statement
D) declaration
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
8
A method's identifier must be more than one word, must have embedded spaces, and can be a Java keyword.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
9
Any class can contain an unlimited number of methods.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
10
An application's main() method must have a void return type.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
11
A(n) ____ causes a value to be sent from a called method back to the calling method.

A) return statement
B) method statement
C) instantiation
D) inheritance relationship
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
12
The ____ method executes first in an application, regardless of where you physically place it within its class.

A) start()
B) run()
C) main()
D) execute()
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
13
When a value is returned from a method, you are required to use the value when the method is called.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
14
A(n) ____ is a program module that contains a series of statements that carry out a task.

A) argument
B) method
C) application
D) declaration
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
15
A(n) ____ variable is known only within the boundaries of the method.

A) method
B) local
C) double
D) instance
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
16
When a variable ceases to exist at the end of a method, programmers say the variable ____.

A) is undeclared
B) is out of memory range
C) goes out of scope
D) is lost
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
17
You can identify a class that is an application because it contains a public static void main() method.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
18
The interface is the part of a method that the method's client does not see.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
19
Every object is a _____ of a more general class.

A) constant
B) member
C) method
D) field
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
20
Data items you use in a call to a method are called ____.

A) arguments
B) instance variables
C) method declarations
D) headers
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
21
The name of the ____ is always the same as the name of the class whose objects it constructs.

A) method
B) constructor
C) argument
D) variable
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
22
A unique identifier is most likely used as a ____ key in a database.

A) special
B) public
C) static
D) primary
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
23
A(n) ____ constructor is one that requires no arguments.

A) class
B) default
C) explicit
D) write
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
24
Public classes are accessible by all objects, which means that public classes can be ____, or used as a basis for any other class.

A) saved
B) extended
C) copied
D) used
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
25
Normally, you declare constructors to be ____________________ so that other classes can instantiate objects that belong to the class.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
26
Often, programmers list the ____________________ first because it is the first method used when an object is created.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
27
Access specifiers are sometimes called access ____________________.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
28
In order to allocate the needed memory for an object, you must use the ____ operator.

A) new
B) main
C) type
D) return
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
29
A(n) ____________________ data type is a type whose implementation is hidden and accessed through its public methods.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
30
Method names that begin with ____ and set are very typical.

A) next
B) call
C) read
D) get
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
31
For ease in locating class methods, many programmers store them in ____ order.

A) chronological
B) type
C) alphabetical
D) numeric
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
32
When an application is run, the method that must be executed first must be named ____.

A) first()
B) void()
C) main()
D) final()
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
33
A(n) ____ method is a method that creates and initializes class objects.

A) constructor
B) accessor
C) non-static
D) instance
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
34
After an object has been instantiated, its methods can be accessed using the object's _____, a dot, and a method call.

A) identifier
B) class
C) operator
D) output
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
35
Assigning ____ to a field means that no other classes can access the field's values.

A) user rights
B) protected access
C) key access
D) private access
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
36
Methods used with object instantiations are called ____ methods.

A) accessor
B) internal
C) static
D) instance
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
37
To execute a method, you ____________________ it from another method.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
38
Which of the following is NOT an initial value assigned to an object's data field by a default constructor?

A) numeric fields set to 0
B) Boolean fields set to true
C) character fields set to Unicode '\u0000'
D) a field of object references set to null
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
39
____ parameters are variables in a method declaration that accept the values from the actual parameters.

A) System
B) Formal
C) Public
D) Static
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
40
Methods that retrieve values are called ____ methods.

A) static
B) accessor
C) class
D) mutator
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
41
Match between columns
Data components of a class
header
Data components of a class
method's signature
Data components of a class
parameter type
Data components of a class
static method
Data components of a class
formal parameters
Data components of a class
return statement
Data components of a class
instance variables
Data components of a class
class user
Data components of a class
data fields
Variables you declare within a class, but outside of any method
header
Variables you declare within a class, but outside of any method
method's signature
Variables you declare within a class, but outside of any method
parameter type
Variables you declare within a class, but outside of any method
static method
Variables you declare within a class, but outside of any method
formal parameters
Variables you declare within a class, but outside of any method
return statement
Variables you declare within a class, but outside of any method
instance variables
Variables you declare within a class, but outside of any method
class user
Variables you declare within a class, but outside of any method
data fields
Used to return a value back to the calling method
header
Used to return a value back to the calling method
method's signature
Used to return a value back to the calling method
parameter type
Used to return a value back to the calling method
static method
Used to return a value back to the calling method
formal parameters
Used to return a value back to the calling method
return statement
Used to return a value back to the calling method
instance variables
Used to return a value back to the calling method
class user
Used to return a value back to the calling method
data fields
Are called class methods
header
Are called class methods
method's signature
Are called class methods
parameter type
Are called class methods
static method
Are called class methods
formal parameters
Are called class methods
return statement
Are called class methods
instance variables
Are called class methods
class user
Are called class methods
data fields
Included within the method declaration parentheses
header
Included within the method declaration parentheses
method's signature
Included within the method declaration parentheses
parameter type
Included within the method declaration parentheses
static method
Included within the method declaration parentheses
formal parameters
Included within the method declaration parentheses
return statement
Included within the method declaration parentheses
instance variables
Included within the method declaration parentheses
class user
Included within the method declaration parentheses
data fields
The first line of a method
header
The first line of a method
method's signature
The first line of a method
parameter type
The first line of a method
static method
The first line of a method
formal parameters
The first line of a method
return statement
The first line of a method
instance variables
The first line of a method
class user
The first line of a method
data fields
An application or a class that instantiates objects of another prewritten class
header
An application or a class that instantiates objects of another prewritten class
method's signature
An application or a class that instantiates objects of another prewritten class
parameter type
An application or a class that instantiates objects of another prewritten class
static method
An application or a class that instantiates objects of another prewritten class
formal parameters
An application or a class that instantiates objects of another prewritten class
return statement
An application or a class that instantiates objects of another prewritten class
instance variables
An application or a class that instantiates objects of another prewritten class
class user
An application or a class that instantiates objects of another prewritten class
data fields
Variables in the method declaration that accept the values from the actual parameters
header
Variables in the method declaration that accept the values from the actual parameters
method's signature
Variables in the method declaration that accept the values from the actual parameters
parameter type
Variables in the method declaration that accept the values from the actual parameters
static method
Variables in the method declaration that accept the values from the actual parameters
formal parameters
Variables in the method declaration that accept the values from the actual parameters
return statement
Variables in the method declaration that accept the values from the actual parameters
instance variables
Variables in the method declaration that accept the values from the actual parameters
class user
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
header
The combination of the method name and the number, types, and order of arguments
method's signature
The combination of the method name and the number, types, and order of arguments
parameter type
The combination of the method name and the number, types, and order of arguments
static method
The combination of the method name and the number, types, and order of arguments
formal parameters
The combination of the method name and the number, types, and order of arguments
return statement
The combination of the method name and the number, types, and order of arguments
instance variables
The combination of the method name and the number, types, and order of arguments
class user
The combination of the method name and the number, types, and order of arguments
data fields
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
42
A major advantage of a method is that it is easily reusable. What does it mean to reuse a method and what are the advantages of doing so?
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
43
What are the two parts of every method? Describe them.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
44
Does a programmer need to write every class he or she uses? Why or why not?
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
45
What are the four components of a method header?
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
46
Write a valid class header with public access. Assign a valid identifier of your choice. Then write the body of the class that contains one data field named myPractice with a data type of double . Be sure to include any necessary curly braces and semicolons.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
47
How do you use a value returned from a method? Provide an example.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
48
  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.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
49
public Employee()
{
empSalary = 300.00;
}
The above code shows the Employee class constructor. What is a constructor and how would this default constructor operate?
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
50
Explain the purpose of a return type of a method. Describe the return value of a method that returns no data.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
51
How do you create an object that is an instance of a class? Provide an example.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
52
What is a method and how is one used?
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
53
How does the order in which methods appear in a class affect how the application executes? Please explain.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
54
public static void predictRaise(double salary)
{
double newSalary;
final double RAISE_RATE = 1.10;
newSalary = salary * RAISE_RATE;
System.out.println("Current salary: " +
salary + " After raise: " +
newSalary);
}
In the above code, what are the parameter data type and parameter identifier? How do you identify each?
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
55
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?
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
56
What are the possible results if arguments to a method are passed in the wrong order?
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
57
Describe instantiation and how it relates to 'is-a relationships.'
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
58
Describe how you can use multiple arguments in a method. Provide an example.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
59
Describe what a public access class is and when you would use one. 
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
60
What is the difference between a mutator method and an accessor method? Provide an example of each.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
61
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.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
62
  In the above code, the calculateBonus() method acts as a black box. What does this mean? In the above code, the calculateBonus() method acts as a "black box." What does this mean?
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
63
  Fill in the blank line in the above code to add a statement that calls a method named practiceWithCalls that passes a parameter named testing of type double.
Fill in the blank line in the above code to add a statement that calls a method named practiceWithCalls that passes a parameter named testing of type double.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
64
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.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
65
Describe fully qualified identifiers and explain why they are necessary.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
66
  In the above code, what would happen if the arguments passed to the method were passed in the wrong order? In the above code, what would happen if the arguments passed to the method were passed in the wrong order?
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 66 flashcards in this deck.