반응형
Answers to Questions and Exercises: Object-Oriented Programming Concepts
Answers to Questions
- Real-world objects contain state and behavior.
- A software object's state is stored in fields.
- A software object's behavior is exposed through methods.
- Hiding internal data from the outside world, and accessing it only through publicly exposed methods is known as data encapsulation.
- A blueprint for a software object is called a class.
- Common behavior can be defined in a superclass and inherited into a subclass using the extends keyword.
- A collection of methods with no implementation is called an interface.
- A namespace that organizes classes and interfaces by functionality is called a package.
- The term API stands for Application Programming Interface.
Answers to Exercises
1. 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.
* Your answers will vary depending on the real-world objects that you are modeling.
2. 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?
* Your answers will vary here as well, but the error message will specifically list the required methods that have not been implemented.
반응형
'프로그램 > Java - 정보' 카테고리의 다른 글
우분투에 java 설치 하기 (0) | 2014.03.03 |
---|---|
JAVA MVC 정보 (0) | 2011.06.23 |
Naver API 연동 + JAVA 사용 방법 (0) | 2011.05.24 |
자바 8개 리스너 (0) | 2011.05.19 |
자바스터디 블로그 (0) | 2011.05.06 |