Inf1 OP : Lab Sheet Week 6
Overview

This week’s exercises provide you with an opportunity to define your own classes. As a reminder, here is a very simple class definition:

public class Circle {

    private double radius; // an instance variable

    public Circle(double radius){
        this.radius = radius; // the instance variable is assigned the value
                              // passed by the method parameter
    }

    public double getArea(){
        return radius * radius * Math.PI;
    }
}

Recall that after the initial declaration, you should first define your instance variables, then write your constructor and finally define your instance methods.