Quiz
The following questions will test your knowledge of objects and the programs that use them.
Questions
1: |
What statement is used to enable one class to inherit from another class?
- inherits
- extends
- handitoverandnobodygetshurt
|
2: |
Why are compiled Java programs saved with the .class file extension?
- Java's developers think it's a classy language.
- It's a subtle tribute to the world's teachers.
- Every Java program is a class.
|
3: |
What are the two things that make up an object?
- Attributes and behavior
- Commands and data files
- Spit and vinegar
|
Answers
A1: |
b. The extends statement is used because the subclass is an extension of the attributes and behavior of the superclass and of any superclasses above that in the class hierarchy.
|
A2: |
c. Your programs will always be made up of at least one main class and any other classes that are needed.
|
A3: |
a. In a way, b also is true because commands are comparable to behavior, and data files are analogous to attributes.
|
|