Code example for Scanner

Methods: nextDouble

0
//        System.out.println("周长为"+4*i); 
        return b*4;
 
    } 
    public static void main(String[] args) {
          Scanner scanner=new Scanner(System.in);
          double b=scanner.nextDouble();
        Square square=new Square(b);
        System.out.println(square.getArea());
 
    } 
 
 
 
 
}