Pencil myMechanic = new Mechanical();  Given the class…

     Pencil myMechanic = new Mechanical();  Given the class hierarchy and code statement above, which of the following methods are allowed and are not allowed to be called on the myMechanic variable? addLead() : [1]place() : [2] For each statement below, indicate which class provides the implementation of each of the methods called. myMechanic.write(); [3]myMechanic.toString(); [4]

Select the best code to utilize generics so that the class i…

Select the best code to utilize generics so that the class implements the Comparable interface correctly. public class Taco implements 1  { private int guacamole; /* valid constructor */ public int compareTo( 2 arg ) {   /* valid implementation */ }}    1   : [1]   2   : [2]

   Geometric mySquare = new Square();  Given the class hiera…

   Geometric mySquare = new Square();  Given the class hierarchy and code statement above, which of the following methods are allowed and are not allowed to be called on the mySquare variable? perimeter() : [1]describe() : [2] For each statement below, indicate which class provides the implementation of each of the methods called. mySquare.draw();    [3]mySquare.toString(); [4]