Exam 7: Object-Oriented Design
Exam 1: Introduction64 Questions
Exam 2: Data and Expressions67 Questions
Exam 3: Using Classes and Objects49 Questions
Exam 4: Writing Classes53 Questions
Exam 5: Conditionals and Loops38 Questions
Exam 6: More Conditionals and Loops35 Questions
Exam 7: Object-Oriented Design44 Questions
Exam 8: Arrays45 Questions
Exam 9: Inheritance49 Questions
Exam 10: Polymorphism40 Questions
Exam 11: Exceptions39 Questions
Exam 12: Recursion55 Questions
Exam 13: Collections60 Questions
Select questions type
Having multiple class methods of the same name where each method has a different number of or type of parameters is known as
(Multiple Choice)
4.8/5
(34)
Assume that the class Bird has a static method fly(). If b is a Bird, then to invoke fly, you could do Bird.fly();.
(True/False)
4.9/5
(36)
The versions of an overloaded method are distinguished by the number, type, and order of their parameters.
(True/False)
4.8/5
(40)
The activities of the development cycle are generally thought to
(Multiple Choice)
4.8/5
(41)
The graphical effect caused when a shape seems to resize as the mouse is dragged is known as rubberbanding.
(True/False)
4.8/5
(32)
Write code that outputs all of the int values between 1 and 100 with five values per line, and each of those five values spaced out equally. Use a single for loop to solve this problem.
(Essay)
5.0/5
(40)
In black-box testing, the tester should already know something about how the program is implemented so that he/she can more carefully identify what portion(s) of the software may lead to errors.
(True/False)
4.8/5
(48)
Explain the difference between implementing an interface and a derived class.
(Essay)
4.8/5
(32)
Code Description Ch 07-1
Consider a class called ChessPiece. This class has two instance data, String type and int player. The variable type will store "King", "Queen", "Bishop", etc. and the int player will store 0 or 1 depending on whose piece it is. We wish to implement Comparable for the ChessPiece class. Assume that, the current ChessPiece is compared to a ChessPiece passed as a parameter.
Pieces are ordered as follows:
"Pawn" is a lesser piece to a "Knight"
a "Bishop" and "Knight" are equivalent for this example
both "Bishop" and "Knight" are lesser pieces to a "Rook"
a "Rook" is a lesser piece to a "Queen"
a "Queen" is a lesser piece to a "King".
-Refer to Code Description Ch 07-1: To implement Comparable for the ChessPiece class, the current ChessPiece's type is compared to a ChessPiece passed as a parameter. The method should return 0 if the types are equal, -1 if this piece's type is a lesser piece than the parameter's type, and 1 if this piece's type is a greater piece than the parameter's type. Create this code.
(Essay)
4.7/5
(30)
Any class can implement an interface, but no classes can implement more than a single interface.
(True/False)
4.9/5
(34)
Assume a class Foo implements Comparable. Without knowing anything else about the Foo class, write an equals method that returns true if the Foo parameter passed to this Foo is equal to this Foo as determined by using the implementation of Comparable.
(Essay)
4.8/5
(29)
Of the various phases in software development, which of the following is usually the lengthiest?
(Multiple Choice)
4.8/5
(34)
Code Description Ch 07-1
Consider a class called ChessPiece. This class has two instance data, String type and int player. The variable type will store "King", "Queen", "Bishop", etc. and the int player will store 0 or 1 depending on whose piece it is. We wish to implement Comparable for the ChessPiece class. Assume that, the current ChessPiece is compared to a ChessPiece passed as a parameter.
Pieces are ordered as follows:
"Pawn" is a lesser piece to a "Knight"
a "Bishop" and "Knight" are equivalent for this example
both "Bishop" and "Knight" are lesser pieces to a "Rook"
a "Rook" is a lesser piece to a "Queen"
a "Queen" is a lesser piece to a "King".
-Refer to Code Description Ch 07-1: Which of the following method headers would properly define the method needed to make this class Comparable? (cp designates ChessPiece)
(Multiple Choice)
4.9/5
(41)
It is important to dissect a problem into manageable pieces before trying to solve the problem because
(Multiple Choice)
4.9/5
(37)
Showing 21 - 40 of 44
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)