So I am working on a hw assignment for a Java programming class and there is some slight confusion.
I am suppose to create a rectangle and I have created two classes; Rectangle.java and RectangleTester.Java.
So far my code for the class Rentangle.java is:
package edu.sbcc.hw2;
public class Rectangle {
private int width = 25;
private int height = 25;
public rectangle(int xcoord, int ycoord, int thewidth, int theheight) {
this.width = width;
this.height = height;
}
public int getWidth() {
return width;
So for my assignment I need two instance variables for height and width for which I have, but it says in the assignment I need methods (settings and getters /mutators and accessors that allow manipulation of my instance variables which is a little confusing. Do I put these methods on Rectangle.java or RectangleTester.java.
The same goes for the calculateArea, where am I suppose to put this?
Am I even on the right track with this assignment or am I way off? I DO NOT want anyone to right anything for me, I want to do it myself, I just need it explained a little better.