






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
The relationship between two model elements, realization, and the concept of interfaces and abstract classes in Object-Oriented Programming (OOP) paradigm. It describes the characteristics of interfaces and abstract classes, how they are implemented, and why they are used. The document also provides examples of interfaces and abstract classes in Java and UML. The main purpose of this document is to provide a basic understanding of interfaces and abstract classes in OOP paradigm.
Typology: Lecture notes
1 / 12
This page cannot be seen from the preview
Don't miss anything!
Realization ➢ a relationship between two model elements, in which one model element realizes the behavior that the other model element specifies. ➢ one entity denotes some responsibility which is not implemented by itself and the other entity that implements them. This relationship is mostly found in the case of interfaces. Interfaces ➢ a group of related methods with empty bodies
Abstract Classes → Have an attribute ➢ If a class includes abstract methods, then the class itself must be declared abstract. → cannot be instantiated/created → can only be base/parent class or a class that can be inherited by another class. → When an abstract class is inherited , the subclass usually provides implementations for all of the abstract methods in its parent class. → if it does not , then the subclass must also be declared abstract. Why interfaces are implemented/created in OOP paradigm? ➢ There are classes that are not inherited in a singular object, different elements but maybe they have something in common in behavior. → Two or more classes have the same behavior even though not from a same parent class, use realization relationship and create interface. List https://docs.oracle.com/javase/8/docs/api/java/util/List.html
Test Main Method
➢ Used when objects are necessarily one, restrict more instances of class Default Constructor: Normal Constructor: