How do I keep the scanner class open to enter a new value for an instance
<p>I have an assignment to create a Circle class which creates a circle using radius and then uses get to find the area, diameter, etc.</p>

<p>The next step in the assignment is to "Continuously use the Scanner object created at beginning to ask user to enter another value for radius." at first I tried to copy+paste the code to ask the user for radius and assign to a local variable like i did originally and I get the following error: "The assigned value is never used." Also the assignment says to change the value of the circle instance, not to make a new circle and assign that a different value.</p>

<p>I did some searches but am unsure how to proceed.</p>

<p>Code for my circle.java class:</p>

<pre><code>public class Circle {

    // intialize variable radius
    private double radius;
    // create constant PI
    public final static double PI = 3.14159;

    // Circle constructtor
    public Circle(double r) {
        radius = r;
    }

    // setRadius method
    public void setRadius(double r) {
        radius = r;
    }

    // getRaduis method
    public double getRadius() {
        return radius;
    }

    // getArea method
    public double getArea() {
        double area = PI * radius * radius;
        return area;
    }

    // getDiameter method
    public double getDiameter() {
        double diameter = 2 * radius;
        return diameter;
    }

    // getCircumference method
    public double getCircumference() {
        double circumference = 2 * PI * radius;
        return circumference;
    }

}
</code></pre>

<p>And the code for my program circleTest:</p>

<pre><code>package circle;

import java.util.Scanner;
public class CircleTest {

    public static void main(String[] args) {
        double circleRadius;
        double radius;

        // import scanner
        Scanner keyboard = new Scanner(System.in);

        // ask user for raduis and store in a local variable
        System.out.print("What is the radius of the circle?");
        circleRadius = keyboard.nextDouble();

        // Create a circle object called circle1
        Circle circle1 = new Circle(circleRadius);

        // display area using getArea method for circle1
        System.out.println("The area of the circle is " + circle1.getArea());

        // display diameter for circle1 using getDiameter method
        System.out.println("The diamter of a the circle is "
                + circle1.getDiameter());

        // display the circumference of circle1 using getCircumference
        System.out.println("The circumference of a circle is "
                + circle1.getCircumference());

        // ask user for radius and store in a local variable
        System.out.print("What is the radius of the circle?");
        circleRadius = keyboard.nextDouble();

    }
}
</code></pre>
