+1 (208) 254-6996 essayswallet@gmail.com
  

(1) An abstract class Shape that has getPerimeter method override… (1) An abstract class Shape   that has  getPerimeter methodoverride the equals method so that two shapes are equal if they are of the same typ and the perimeter is the same and a static field counter that keep track of the Shapes object created  a static method: getCounter to return the counter(2) Rectangle classhas two constructors: default, and one with two parameters for length and widthset methods for length and widthoverride getPerimeteroverride the toString methodoverride the hashCode method(3) triangle classhas two constructors: default, and one with 3 parameters for side lengthset methods for side length override getPerimeteroverride the toString methodoverride the hashCode method (4) test all classes and methods.   In class we discussed the following code and the output , you can also use it as part of testing for equals method and hashCode     ArrayList shapeList = new ArrayList();    Rectangle r1 = new Rectangle(3,8);    Rectangle r2 = new Rectangle(5,6);        shapeList.add(r1);    System.out.println(shapeList.contains(r2));              HashSet shapeSet = new HashSet() ;    shapeSet.add(r1);    shapeSet.add(r2);   Triangle t1 = new Triangle(3,3,2);  System.out.println(shapeSet.size());   Computer Science Engineering & Technology Java Programming CIT 295

Don't use plagiarized sources. Get Your Custom Essay on
Top answer: (1) An abstract class Shape that has getPerimeter method override…
Just from $10/Page
Order Essay

Order your essay today and save 10% with the discount code ESSAYHELP