📄 color.java
字号:
class Color{
int red;
int green;
int blue;
public Color(int red,int green,int blue){
this.red=red;
this.green=green;
this.blue=blue;
}
public void setRed(int red){
this.red=red;
}
public void setGreen(int green){
this.green=green;
}
public void setBlue(int blue){
this.blue=blue;
}
public void display(){
System.out.println("red:"+red);
System.out.println("green:"+green);
System.out.println("blue:"+blue);
}
/*
//copy constructor
public Color(Color other){
red=other.red;
green=other.green;
blue=other.blue;
}
//clone method
public Color clone(){
Color obj=null;
try{
obj=(Color)super.clone();
}
catch(Exception e){
e.printStackTrace();
obj=null;
}
return obj;
//return new Color(red,green,blue);
}
*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -