digital-garden/notes/Собеседования/Задачи/Задача 23.md
2024-06-13 21:01:37 +03:00

25 lines
488 B
Markdown

---
parents:
- "[[Вопросы для собеседование Java]]"
---
```java
public class Application {
private Service service;
public Application(Service service) {
this.service = service;
}
public void start() {
service.serve();
}
}
public class App {
public static void main(String[] args) {
Service service = new ServiceImpl();
Application app = new Application(service);
app.start();
}
}
```