Version 5 (modified by jazz, 3 years ago) (diff) |
---|
2021-09-22
- http://www.plantuml.com/plantuml/png/SoWkIImgAStDuKfCAYufIamkKO02nxpCtCGShioyajIYjCJaLAYmStvEVX66g7jgNafg4HT4Zu9DZQukPq1cEWhV9H-LxvnOmWLK0zGCLvzUoUMI3nS16mpa0qM1Qb54lJDBIbBpkC1k0GdhwO65GKP2N88gvW0K0teH0000
@startuml abstract Animal interface Color interface Gender Animal <|-- Pig Animal <|-- Dog Animal <|-- Cat Pig <|-- Piggy Dog <|-- Doggy Cat <|-- Kitten Color <|.. Cat Gender <|.. Cat @enduml
public class HelloWorld{ public static void main(String []args){ System.out.println("Hello World"); Animal a = new Cat(); Animal b = new Kitten(); a.who_am_i(); b.who_am_i(); } } abstract class Animal { abstract void who_am_i(); } class Cat extends Animal { void who_am_i() { System.out.println("I'm a Cat"); } } class Kitten extends Cat { void who_am_i() { System.out.println("I'm a Kitten"); } }
Attachments (1)
-
OOP_Concepts.png
(15.4 KB) -
added by jazz 3 years ago.
Object Oriented Programming Concepts
Download all attachments as: .zip