|
| 1 | +package com.baeldung.inheritancecomposition.application; |
| 2 | + |
| 3 | +import com.baeldung.inheritancecomposition.model.Actress; |
| 4 | +import com.baeldung.inheritancecomposition.model.Computer; |
| 5 | +import com.baeldung.inheritancecomposition.model.StandardMemory; |
| 6 | +import com.baeldung.inheritancecomposition.model.Person; |
| 7 | +import com.baeldung.inheritancecomposition.model.StandardProcessor; |
| 8 | +import com.baeldung.inheritancecomposition.model.StandardSoundCard; |
| 9 | +import com.baeldung.inheritancecomposition.model.Waitress; |
| 10 | + |
| 11 | +public class Application { |
| 12 | + |
| 13 | + public static void main(String[] args) { |
| 14 | + |
| 15 | + Person person = new Person("John", "john@domain.com", 35); |
| 16 | + Waitress waitress = new Waitress("Mary", "mary@domain.com", 22); |
| 17 | + System.out.println(waitress.serveStarter("mixed salad")); |
| 18 | + System.out.println(waitress.serveMainCourse("steak")); |
| 19 | + System.out.println(waitress.serveDessert("cup of cofee")); |
| 20 | + Actress actress = new Actress("Susan", "susan@domain.com", 30); |
| 21 | + System.out.println(actress.readScript("Psycho")); |
| 22 | + System.out.println(actress.performRole()); |
| 23 | + Computer computer = new Computer(new StandardProcessor("Intel I3"), new StandardMemory("Kingston", "1TB")); |
| 24 | + computer.setSoundCard(new StandardSoundCard("Generic Sound Card")); |
| 25 | + System.out.println(computer); |
| 26 | + } |
| 27 | +} |
0 commit comments