Exam 3: Implementing Classes
Exam 1: Introduction76 Questions
Exam 2: Using Objects82 Questions
Exam 3: Implementing Classes108 Questions
Exam 4: Fundamental Data Types124 Questions
Exam 5: Decisions119 Questions
Exam 6: Loops107 Questions
Exam 7: Arrays and Array Lists117 Questions
Exam 8: Designing Classes88 Questions
Exam 9: Inheritance99 Questions
Exam 10: Interfaces100 Questions
Exam 11: Input/Output and Exception Handling108 Questions
Exam 12: Object-Oriented Design104 Questions
Exam 13: Recursion99 Questions
Exam 14: Sorting and Searching100 Questions
Exam 15: The Java Collections Framework102 Questions
Exam 16: Basic Data Structures102 Questions
Exam 17: Tree Structures102 Questions
Exam 18: Generic Classes75 Questions
Exam 19: Stream Processing85 Questions
Exam 20: Graphical User Interfaces75 Questions
Exam 21: Advanced Input/Output90 Questions
Exam 22: Multithreading81 Questions
Exam 23: Internet Networking74 Questions
Exam 24: Relational Databases75 Questions
Exam 25: XML74 Questions
Select questions type
Consider the following invocation of the deposit method:
mySavings.deposit(250);
What is the explicit parameter?
(Multiple Choice)
4.8/5
(37)
Instance variables that are numbers are initialized to what default value?
(Multiple Choice)
4.9/5
(35)
We want to create a class that represents a geometric sequence.A geometric sequence is a sequence of numbers that begin at some value and then multiplies each value by some constant to get the next value.For example, the geometric sequence 1, 2, 4, 8, 16 starts at 1 and multiplies each term by 2 to get the next.The geometric sequence 10.8, 5.4, 2.7, 1.35 starts at 10.8 and multiplies each term by 0.5 to get the next.The basic framework of a geometric sequence class is below: public class Geometricsequence
{
private double currentvalue;
private double multiplier;
}
We want to create a geometric sequence using code like:
Geometricsequence first = new Geometricsequence (1,2);
// Creates 1, 2, 4, 8, 16...
Geometricsequence second = new Geometricsequence (10.8,0.5);
/ / Creates 10.8,5.4,2.7,1.35 ...
We want to produce elements of the geometric sequence using code code like:
System.out.println (first.next()); // Prints 1 and advances
System.out.println (first.next()); // Prints 2 and advances
System.out.println (first.next()); // Prints 4 and advances
System.out.println (first.next()); // Prints 8 and advances
System.out.println (second.next()); //Prints 10.8 and advances
System.out.println (second.next()); //Prints 5.4 and advances
System.out.println (second.next()); //Prints 2.7 and advances
What should the body of the next method be?
(Multiple Choice)
5.0/5
(38)
Which of the following corresponds to the getArea method header for a Square class assuming an integer value for a side length?
(Multiple Choice)
4.9/5
(49)
Consider the following code fragment from the Italian Flag program in How To 3.2:
Which of the following statements is true?

(Multiple Choice)
4.8/5
(40)
The use of an instance variable name inside a method denotes the instance variable of what?
(Multiple Choice)
4.8/5
(33)
What are the operations that any programmer can use to create and manipulate objects of the class called?
(Multiple Choice)
4.9/5
(34)
When you declare a method, you also need to provide the method ____, which consists of statements that are executed when the method is called.
(Multiple Choice)
4.8/5
(39)
Which statement describes a central benefit of information hiding?
(Multiple Choice)
4.8/5
(39)
Which special delimeter is used with the javadoc utility to document method arguments?
(Multiple Choice)
4.9/5
(38)
A class declaration consists of which of the following parts?
(Multiple Choice)
4.8/5
(42)
Identify the explicit parameter of the withdraw method of the BankAccount class.
(Multiple Choice)
4.8/5
(37)
We want to create a class that represents a geometric sequence.A geometric sequence is a sequence of numbers that begin at some value and then multiplies each value by some constant to get the next value.For example, the geometric sequence 1, 2, 4, 8, 16 starts at 1 and multiplies each term by 2 to get the next.The geometric sequence 10.8, 5.4, 2.7, 1.35 starts at 10.8 and multiplies each term by 0.5 to get the next.The basic framework of a geometric sequence class is below:
Which of the constructor specifications below will allow this code to behave as desired?

(Multiple Choice)
4.8/5
(42)
We want to create a class that represents a date.A date has a day, month, and year.For example, the date March 16, 2014 has the day 16, month 3, and year 2014.The parameter variables in the constructor for month, day, and year should be m, d and y.The basic framework of a date class is below: public class Date
{
private int day;
private int month;
private int year;
}
What should the body of the constructor be?
(Multiple Choice)
4.8/5
(36)
Consider the following invocation of the deposit method:
mySavings.deposit(250);
What is the implicit parameter?
(Multiple Choice)
4.8/5
(35)
Consider the following method header for the BankAccount class:
Fill in the blank in the method body.

(Multiple Choice)
4.8/5
(33)
Which of the following statements is true about constructors?
(Multiple Choice)
4.8/5
(31)
Showing 21 - 40 of 108
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)