I have a class Child that extends Parent.
Child
Parent
Parent child = new Child(); if (child instanceof Parent){ // Do something } <
Parent child = new Child(); if (child instanceof Parent){ // Do something }
ofcourse it returns true because child is an instance of the parent