I have this question, this is the diagram that I was given, and I have managed to come with a solution, but the actual question itself is asking me to implement the get and set methods, which I am not sure if they are applicable here,


This is just part of the a bit long question, did not want to make it look like I want my homework done by the users here by pasting the whole question, but just a doubt, if get and set methods indeed can be implemented how can I do that?
So this is my code, what I have come with so far
public abstract class Property
{
private static int autonumber = 0, propID,area,price;
private String address;
public Property(String addr, int area,int price)
{
autonumber++;
propID = autonumber;
this.area = area;
this.price = price;
}
public abstract double calculateMiscFee();
public int getArea()
{
return area;
}
public void setArea()
{
}
// public double calculateMiscFee()
// {
// return 100*
// }
}
This is the latest code I have
public abstract class Property
{
private static int autonumber = 0;
private int propID;
private int area;
private double price;
private String address;
private int district;
public Property(String addr, int area,double price, int district)
{
autonumber++;
propID = autonumber;
this.area = area;
this.price = price;
this.district = district;
this.address = addr;
}
public abstract double calculateMiscFee();
public int getArea()
{
return area;
}
public void setArea(int a)
{
area = a;
}
public String getAddress()
{
return address;
}
public void setAddress(String add)
{
address = add;
}
public double getPrice()
{
return price;
}
public void setPrice(double p)
{
price = p;
}
public int getDistrict()
{
return district;
}
public void setDistrict(int disc)
{
district = disc;
}
// public double calculateMiscFee()
// {
// return 100*
// }
public String toString()
{
}
}
propID, area and price should not be
static.staticvariables are shared between all instances of a class, and these variables should be per instance, just like address.If a class declares a variable
abcof typeString, the getter and setter forabcwould look like the following:toString()is a method which already exists in all classes, but you can still override it. For example: