public class Test1
{
private double width = 10;
// accessor method
public double getWidth()
{
return width;
}
// mutator method
public void changeWidth(double change)
{
width = width + change;
}
public static void main(String[] args)
{ Test1 t = new Test1();
double wid = t.getWidth();
System.out.println("wid: " + wid);
t.changeWidth(5);
wid = t.getWidth();
System.out.println("wid: " + wid);
}
}