Exam 3: Implementing Classes
Exam 1: Introduction98 Questions
Exam 2: Using Objects76 Questions
Exam 3: Implementing Classes103 Questions
Exam 4: Fundamental Data Types125 Questions
Exam 5: Decisions120 Questions
Exam 6: Loops128 Questions
Exam 7: Arrays and Array Lists118 Questions
Exam 8: Designing Classes95 Questions
Exam 9: Inheritance101 Questions
Exam 10: Interfaces85 Questions
Exam 11: Inputoutput and Exception Handling109 Questions
Exam 12: Object-Oriented Design104 Questions
Exam 13: Recursion110 Questions
Exam 14: Sorting and Searching109 Questions
Exam 15: The Java Collections Framework110 Questions
Exam 16: Basic Data Structures104 Questions
Exam 17: Tree Structures110 Questions
Exam 18: Generic Classes75 Questions
Exam 19: Graphical User Interfaces76 Questions
Exam 20: Streams and Binary Inputoutput82 Questions
Exam 21: Multithreading82 Questions
Exam 22: Internet Networking74 Questions
Exam 23: Relational Databases75 Questions
Exam 24: XML74 Questions
Exam 25: Web Applications75 Questions
Select questions type
Which of the following is an instance variable of the CashRegister class?
(Multiple Choice)
4.9/5
(34)
Which of the following declares a sideLength instance variable for a Square class that stores an integer value?
(Multiple Choice)
4.9/5
(38)
Consider the following method comment and method header: /**
Converts from a source measurement to a target measurement.
__________ fromMeasurement the measurement
@return the input value converted to the target unit
*/
Public double convertTo(double fromMeasurement) { . . . }
Fill in the blank.
(Multiple Choice)
4.9/5
(37)
What is the name of the parameter variable of the recordPurchase method of the CashRegister class?
(Multiple Choice)
4.8/5
(36)
If a method has two parameters, one explicit and one implicit, and a return type of void, then the documentation comments should include:
(Multiple Choice)
4.7/5
(46)
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 initialValue;
Private double multiplier;
}
We want to produce elements of the geometric sequence using 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
Which of the method specifications below will allow this code to behave as desired?
(Multiple Choice)
4.7/5
(36)
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
(35)
What verifies that a class works correctly in isolation, outside a complete program?
(Multiple Choice)
4.9/5
(36)
Complete the following tester program by choosing the line that prints the expected outcome. public class BankAccountTester
{
Public static void main(String[] args)
{
BankAccount account = new BankAccount(1000);
Account.deposit(account.getBalance());
System.out.println(account.getBalance());
___________________
}
}
(Multiple Choice)
4.8/5
(42)
What are the operations that any programmer can use to create and manipulate objects of the class called?
(Multiple Choice)
4.9/5
(39)
Choose the method header that goes with this method comment. /**
Gets the salary of the employee
@return the salary of the employee
*/
(Multiple Choice)
4.8/5
(42)
Consider the following invocation of the deposit method: mySavings.deposit(250);
What is the implicit parameter?
(Multiple Choice)
4.9/5
(35)
Showing 81 - 100 of 103
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)