Answers to Questions and Exercises: Object-Oriented Programming Concepts

Answers to Questions

  1. Real-world objects contain state and behavior.
  2. A software object’s state is stored in fields.
  3. A software object’s behavior is exposed through methods.
  4. Hiding internal data from the outside world, and accessing it only through publicly exposed methods is known as data encapsulation.
  5. A blueprint for a software object is called a class.
  6. Common behavior can be defined in a superclass and inherited into a subclass using the extends keyword.
  7. A collection of methods with no implementation is called an interface.
  8. A namespace that organizes classes and interfaces by functionality is called a package.
  9. The term API stands for Application Programming Interface.

Answers to Exercises

  1. Your answers will vary depending on the real-world objects that you are modeling.
  2. Your answers will vary here as well, but the error message will specifically list the required methods that have not been implemented.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s