Created
March 29, 2016 14:19
-
-
Save aioobe/0a7feacfd467e5b9ef41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
Person andreas = new Person("Andreas"); | |
Werewolf w = new Werewolf(andreas); | |
w.brain.think(); | |
} | |
} | |
class Person { | |
String name; | |
public Person(String name) { | |
this.name = name; | |
} | |
public class Brain { | |
public void think() { | |
System.out.println(name + " is thinking"); | |
} | |
} | |
} | |
class Werewolf { | |
WerewolfBrain brain; | |
public Werewolf(Person p) { | |
brain = new WerewolfBrain(); | |
} | |
class WerewolfBrain extends Person.Brain { | |
WerewolfBrain() { | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment