java
public class Mouse {
private String brand;
private int buttons;
private boolean wireless;
public Mouse(String brand, int buttons, boolean wireless) {
this.brand = brand;
this.buttons = buttons;
this.wireless = wireless;
}
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public int getButtons() {
return buttons;
}
public void setButtons(int buttons) {
this.buttons = buttons;
}
public boolean isWireless() {
return wireless;
}
public void setWireless(boolean wireless) {
this.wireless = wireless;
}
public void click() {
System.out.println("Mouse clicked");
}
public void scroll(int direction) {
System.out.println("Scrolling " + (direction > 0 ? "up" : "down"));
}
}
顶一下
(0)
0%
踩一下
(0)
0%
- 相关评论
- 我要评论
-
上一篇:返回栏目
下一篇:java 补齐数字位数