FOR TYPE1 TO TYPE5 FILES, COMPLETE THE HEADER WITH THE FORMAT BELOW CHOOSING BETWEEN CLASS OR INTERFACE, EXTENDS OR IMPL
Posted: Fri Jul 01, 2022 5:51 am
TypeOne.java, TypeTwo.java, TypeThree.java, Type Four.java, and TypeFive.java This is what we know: TypeOne a TypeFour b new TypeOne (); // is valid new TypeOne (); //is valid Type Two c new TypeOne (); //is valid TypeFour d new TypeFour (); //error "Cannot instantiate the type TypeFour" new TypeTwo (); //error "Cannot instantiate the type Type Two" = = = = TypeTwo e Type Two s new TypeFive (); //is valid a instanceof TypeFour; // return true b instanceof TypeTwo; // return true c instanceof TypeFour; // return true c instanceof TypeTwo; //return true s instanceof TypeTwo; //return true s instanceof TypeFour; //return false = = TypeOne f new Type Three (); //is valid TypeThree g new TypeThree (); //is valid f.methodOne (); //error "The method methodOne () is undefined for the type Type One" g.methodOne (); // is valid =
(public class/interface XXX extends/implements YYY):