Question
Java You have a class in your program called Animal that has methods for eat, sleep, and move. You need to create a Bird class,
Java
You have a class in your program called Animal that has methods for eat, sleep, and move. You need to create a Bird class, with a different implementation of the move method. What relationship should the Bird class have with the Animal class?
Question 4 options:
| aggregation |
| inheritance |
| encapsulation |
| overloading |
Question 5
What is the relationship between the Car and Engine classes shown below?
class Car { private String make; private String model; private int year; private Engine engine; }
public class Engine { private String manufacturer; private int numberOfCylinders; }
Question 5 options:
| inheritance |
| aggregation |
| overriding |
| overloading |
Question 6
Which of these is an example of auto unboxing?
Question 6 options:
| int x = 5;
Integer y = x; |
| Integer x = new Integer(5);
|
| ArrayList myList = new ArrayList();
myList.add(5); |
| ArrayList myList = new ArrayList();
myList.add(new Integer(5));
int x = myList.get(0); |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started