The Java Tutorials have been written for JDK 8. Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no longer available.
See Java Language Changes for a summary of updated language features in Java SE 9 and subsequent releases.
See JDK Release Notes for information about new features, enhancements, and removed or deprecated options for all JDK releases.
Questions and Exercises: Object-Oriented Programming Concepts
Questions
- Real-world objects contain ___ and ___.
- A software object's state is stored in ___.
- A software object's behavior is exposed through ___.
- Hiding internal data from the outside world, and accessing it only through publicly exposed methods is known as data ___.
- A blueprint for a software object is called a ___.
- Common behavior can be defined in a ___ and inherited into a ___ using the ___ keyword.
- A collection of methods with no implementation is called an ___.
- A namespace that organizes classes and interfaces by functionality is called a ___.
- The term API stands for ___?
Exercises
- Create new classes for each real-world object that you observed at the beginning of this trail. Refer to the Bicycle class if you forget the required syntax.
- For each new class that you've created above, create an interface that defines its behavior, then require your class to implement it. Omit one or two methods and try compiling. What does the error look like?
Check your answers.