Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Generic Car class
- class Car {
- Engine engine;
- Wheels wheels;
- // Car class relies on concrete Engine and Wheels object before instantiation
- Car(Engine engine, Wheels wheels) {
- this.engine = new Engine();
- this.wheels = new Wheels();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement