I get the point you are making, but based on the code I have written, it seems like I am not using the move method at all.

Code:

public class Circle {
//Fields of the class.
public double radius;
public double xCoord;
public double yCoord;
public int x;
public int y;
//Main method and the object of the class.
public static void main(String[] args) {
Circle cir= new Circle();
cir.printAttributes();
}
//First constructor; sets default values.
public Circle(){
this.radius=100;
this.xCoord=10;
this.yCoord=10;
}
//The second constructor takes three doubles as parameters corresponding to the X and Y coordinates & the radius.
public Circle(double x,double y,double r){
radius=r;
xCoord=x;
yCoord=y;
}
//Checks the radius against a maximum radius value. If the radius is higher than the maximum radius;
//The ternary conditional operator resets the value to the specified maximum radius.
public void setRadius(double r){
double maxR=100.00;
radius= (r > maxR)?maxR:r;
}
//Returns the radius value.
public double getRadius(double r) {
return radius;
}
//Returns X-Coordinate.
public double getxCoord() {
return xCoord;
}
//Returns Y-Coordinate.
public double getyCoord() {
return yCoord;
}
//Returns X value.
public int getX() {
return x;
}
//Returns Y value.
public int getY() {
return y;
}
//Returns the circumference of the circle.
public double circumference(){
return Math.PI*2*radius;
}
//Returns the area of the circle.
public double area(){
return (radius*radius)*Math.PI;
}
//Prints the coordinates, the radius, the circumference, and the area.
public void printAttributes(){
System.out.println("**Java Circle Class**");
System.out.println("");
System.out.println("Area: "+area()+"\nCircumference: "+circumference()+"\nRadius: "+getRadius(300)+"\nX-Coordinate: "+xCoord+"\nY-Coordinate: "+yCoord+"\nPoints fall inside the circle? "+isInside(x, y));
}
//Returns true if a point represented in the parameters falls inside the circle, false otherwise.
public boolean isInside(double x, double y) {
double distance;
x=x-xCoord;
y=y-yCoord;
distance= Math.sqrt((x*x)+(y*y));
if(distance<radius)
return true;
else
return false;
}
//Moves the origin by a specified amount.
public void move(int x, int y) {
x=10;
y=10;
}

Tweet This+ 1 thisPost To Linkedin