* @author Administrator
*/
public class rectangle {
int width,height;
Scanner input;
public void set(){
input=new Scanner(System.in);
width=input.nextInt();
height=input.nextInt();
}
public int Setarea(){
return height*width;
}
public int Setcircumference(){
return (height+width)*2;
}
public String toString(){
return("鐭╁舰闀夸负锛?+width+"\n鐭╁舰瀹戒负锛?+height+"\n鐭╁舰闈㈢Н涓猴細"+height*width+"\n鐭╁舰鍛ㄩ暱涓猴細"+(height+width)*2);
}
@Override
public boolean equals(Object x){
if(this.getClass()!=x.getClass())
return false;
rectangle y=(rectangle)x;
return
((this.Setarea()==y.Setarea())&&(this.Setcircumference()==(y.Setcircumference()))); }
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
rectangle a=new rectangle();
rectangle b=new rectangle();
a.set();
b.set();
a.equals(b);
System.out.println(a);
System.out.println(b);
System.out.println(a.equals(b));