Question
Need help with this. Must be in java. print the color of each object and compare if they are equal kinda like this x=x, y=y,
Need help with this. Must be in java. print the color of each object and compare if they are equal kinda like this x=x, y=y, color=color.
Write the coloring point class such that it implements the coloring interface and extends the Point class so that it can have colors. Override the toString() method to print out the coordinates and color of the Point, override the equals() method so that it compares color as well. Write the necessary constructors, accessors, and mutators.
Write a client class, ColoringClient, and create two different objects of the ColoringPoint class (CP_blue and CP_orange). Print the color of each object and compare if they are equal (x=x, y=y, color=color).
cp1 : (11, 22), color: blue cp2 : (10, 12), color :orange cp1 equals cp2 : false cp3: (11, 22), color : blue cp3 equals cp1 : true cp1 : (11, 22), color: blue cp2 : (10, 12), color :orange cp1 equals cp2 : false cp3: (11, 22), color : blue cp3 equals cp1 : trueStep 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