Originally posted by gowher amin naik: on page no 286 table no-4-1 column 6 book says if "Foo array is instanceof Foo,Bar,Face then result is false". Now see code below i tried to convert above statement in code
Now code gives compile error. By doubt is how Foo array can take Bar and Face Object.
Well I must say that code has so many errors.
1. Foo is a sub class for Bar and Face. You cann't create an Reference of sub class which is pointing an object of Super class.
2. You are creating new Face() i.e. you are creating object of an Interface An interface never be instantiated...
You can try below given code this will clear your situation.
Hope this helps you.
The Best way to predict your future is to create it