package wodejava;
interface Ishape{
public double area();
}
class Square implements Ishape{
double b;
public Square(double a){
b=a;
}
public double area(){
return b*b;
}
void printinfo(){
System.out.println("正方形的面积是:"+area());
}
}
public class Squaretext {
interface Ishape{
public double area();
}
class Square implements Ishape{
double b;
public Square(double a){
b=a;
}
public double area(){
return b*b;
}
void printinfo(){
System.out.println("正方形的面积是:"+area());
}
}
public class Squaretext {
public static void main(String[] args) {
// TODO Auto-generated method stub
Square sq=new Square(2);
sq.printinfo();
}
// TODO Auto-generated method stub
Square sq=new Square(2);
sq.printinfo();
}
}