Answered step by step
Verified Expert Solution
Question
1 Approved Answer
jaba code please explain Create a class named Polygon that represents a geometric shape. - It should have data fields for the polygon's name and
jaba code please explain
Create a class named Polygon that represents a geometric shape. - It should have data fields for the polygon's name and its vertices (a list of at least three vertices, each having x and y coordinates). - It should have a constructor with parameters for the name and vertices, - Override the equals() method. It should consider two polygons as the same if they have the same name and the same set of vertices (regardless of vertex order). - Override the hashCode() method. Test your Polygon class by making sure it works properly with HashMap. Different Polygon objects with the same data should be considered the same by HashMap. In other words, when Polygon is used as a key, the two Polygon objects shouldn't result in two entries in the map. Turn in the following, - The source files (no zip file, just the individual java files). - A screen shot of your program in action. It should show the result of the test run Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started