Java Reference
In-Depth Information
public void turnDown() {
volume -= 1;
}
}
which of the following OO design patterns does the Television class more closely
adhere to?
A. Tight encapsulation
B. Tight coupling
C. High cohesion
D. Low cohesion
3. Fill in the blank: Minimizing the dependencies an object has on other objects is referred
to as
.
A. Tight encapsulation
B. Loose coupling
C. High cohesion
D. The is-a relationship
E. The has-a relationship
4. Which of the following is not a benefit of tight encapsulation and loose coupling?
A. Information hiding
B. Code changes have a smaller ripple effect on other classes.
C. Easier reuse of code
D. Decreases the need to test the code
5. Which one of the following uses of inheritances is probably not a good design?
A. Car extends Vehicle
B. Elephant extends Mammal
C. Laptop extends Computer
D. Square extends Triangle
E. Apple extends Fruit
6. Given the following class definitions:
1. public class Parent {
2. protected void sayHi() {
3. System.out.print(“Hi”);
4. }
5. }
Search WWH ::




Custom Search