And if anyone could help out with why I can't attach solutions atm? public class Solution { public static void main(String[] args) throws Exception { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); Person person = null; String key; while (!(key = reader.readLine()).equals("exit")) { if ("player".equals(key)) { person = new Player(); } else if ("dancer".equals(key)) { person = new Dancer(); } haveFun(person); } } public static void haveFun(Person person) { //write your code here if (person instanceof Player){ ((Player) person).play(); } if (person instanceof Dancer){ ((Dancer) person).dance(); } } interface Person { } static class Player implements Person { void play() { System.out.println("playing"); } } static class Dancer implements Person { void dance() { System.out.println("dancing"); } } }