Object Oriented Programming Conclusion
This module delved into object-oriented programming (OOP) and its relevance to Java. You started out the module by learning about objects and classes, which form the basis for OOP.
You also learned about inheritance, which allows classes to inherit functionality from other classes.
To summarize what was previously discussed, Java is an object-oriented programming (OOP) language. Object orientation helps a developer to achieve a modular, extensible, maintainable, and reusable system.
To write good-quality programs, a programmer must have a firm command of OOP concepts. Object-oriented programming revolves around the concept of an object, which encapsulates data and behavior acting on the data together.
An object provides its services through a well-defined interface. This interface specifies "what" the object offers, abstracting "how" (actual implementation). Object orientation provides support for modeling solutions at a higher level of abstraction in terms of classes, a hierarchy of related classes (inheritance), association among classes, and dynamic binding (dynamic polymorphism).
For any OCPJP exam, you are expected to know essential OOP concepts.
The foundations of OOP are:
The concepts related to classes covered constructors and access modifiers in detail.
- inheritance, and
Essentials of OOP
To get a sense of the world of object-oriented programming, take a mental stroll around the television department of your local consumer electronics retailer.
A television is an abstraction that offers certain functionality through the proper interface (a TV remote). As a viewer, you need not understand how the TV works; the TV abstracts all the details of its operation from the viewer (abstraction).
A television object encapsulates properties of the television (such as brightness, channel number, and volume) and associated behavior to control these properties in a single entity (encapsulation).
In other words, the access to these properties is restricted to the associated operations. There are different types of televisions, such as CRT television, LED television, and LCD television;
they belong to a single family forming an inheritance hierarchy. Although all types of televisions support "display" functionality, the internal technology enabling the display of content may differ (polymorphism).
With this television analogy in mind and with the help of the programming examples discussed in this module, you now have a better understanding of OOP concepts.
This module discussed how the following terms relate to Java:
- Object-oriented programming (OOP): Object-oriented programming is the implementation of a program or algorithm using objects.
- Object: An object is a collection of data and the procedures (methods) that act on that data.
- Class: A class is a template that defines the implementation of an object, effectively acting as a blueprint for the object. A class defines data and methods and is a unit of organization in a Java program.
- Inheritance: Inheritance is the ability to derive new classes from existing classes in object-oriented programming.
- Method: A method is an isolated section of code in an object that performs a particular function.
- Message: In object-oriented programming, sending a message to an object to invoke a method is similar to calling a procedure in structured programming languages.
Java TM Fundamentals I Research
Do you have any questions regarding Java, J2EE, or web programming?Click the Search button at the top of the page to conduct additional research.
Object Programming Quiz