mirror of
https://github.com/Dichgrem/Java.git
synced 2025-12-16 20:42:00 -05:00
style:fmt
This commit is contained in:
@@ -1,37 +1,38 @@
|
||||
package com.study.demo2;
|
||||
|
||||
public class Rectangle {
|
||||
private double width = 1.0;
|
||||
private double height = 1.0;
|
||||
private double width = 1.0;
|
||||
private double height = 1.0;
|
||||
|
||||
public Rectangle() {}
|
||||
public Rectangle() {
|
||||
}
|
||||
|
||||
public Rectangle(double width, double height) {
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
public Rectangle(double width, double height) {
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public double getArea() {
|
||||
return width * height;
|
||||
}
|
||||
public double getArea() {
|
||||
return width * height;
|
||||
}
|
||||
|
||||
public double getPerimeter() {
|
||||
return 2 * (width + height);
|
||||
}
|
||||
public double getPerimeter() {
|
||||
return 2 * (width + height);
|
||||
}
|
||||
|
||||
public double getWidth() {
|
||||
return width;
|
||||
}
|
||||
public double getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public void setWidth(double width) {
|
||||
this.width = width;
|
||||
}
|
||||
public void setWidth(double width) {
|
||||
this.width = width;
|
||||
}
|
||||
|
||||
public double getHeight() {
|
||||
return height;
|
||||
}
|
||||
public double getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public void setHeight(double height) {
|
||||
this.height = height;
|
||||
}
|
||||
public void setHeight(double height) {
|
||||
this.height = height;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user