Output
Variable Name     Value in Memory
radius
area
  1  import java.util.Scanner; // Scanner is in the java.util package
  2  
  3  public class ComputeAreaWithConsoleInputWithConsoleInput {
  4    public static void main(String[] args) {
  5      // Create a Scanner object
  6      Scanner input = new Scanner(System.in);
  7      
  8      // Prompt the user to enter a radius
  9      System.out.print("Enter a number for radius: ");
 10      double radius = input.nextDouble();
 11  
 12      // Compute area
 13      double area = radius * radius * 3.14159;
 14  
 15      // Display result
 16      System.out.println("The area for the circle of radius " +
 17        radius + " is " + area);
 18    } 
 19  }