An exercise for referencing to an instance variable that is an object

 

Main.java     ClassA.java        ClassB.java

 

Sample running: