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?

  1. inherits
  2. extends
  3. handitoverandnobodygetshurt
2:

Why are compiled Java programs saved with the .class file extension?

  1. Java's developers think it's a classy language.
  2. It's a subtle tribute to the world's teachers.
  3. Every Java program is a class.
3:

What are the two things that make up an object?

  1. Attributes and behavior
  2. Commands and data files
  3. 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.

      
Comments