Question: Please explain clearly with steps. Its a very small code . thanks I would rate positively. Write a class pixel in java with following properties.
Please explain clearly with steps. Its a very small code . thanks I would rate positively.
Write a class pixel in java with following properties.
A Pixel has x, y coordinates, which are both integer values. A Pixel also has the following behaviors:
- It can return the value of its x and y coordinates. Use the follwoing method signatures to implement these behaviors. public int getX( ) public int getY( )
- It can change the value of its x and y coordinates. Use the following method signatures to implement these behaviours. public void setX(int xCoord ) public void setY(int yCoord )
- It can also return the x, y coordinates in a format exactly like (x,y). Use the method signature: public String toString( )
- The Pixel also has a construcor that initilizes the values of x, y coordinates to their default values.
- It also has a second constructor that initializes the coordinates to given values. Use the signature: public Pixel (int x, int y)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
