Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- Bar bar = new Bar();
- bar.doSomething();
- }
- }
- class Foo {
- public Foo() {
- doSomething();
- }
- public void doSomething() {
- System.out.println("Do something important!");
- }
- }
- class Bar extends Foo {
- public void doSomething() {
- System.out.println("YOLO!");
- Zoom zoom = new Zoom(this);
- }
- }
- class Zoom {
- public Zoom(Bar bar) {
- bar.doSomething();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment