colorset.java
来自「软件工程实践课程的答案哦」· Java 代码 · 共 49 行
JAVA
49 行
import java.io.*;
public class ColorSet implements Serializable
{
private static final long serialVersionUID = -1048976934899866394L;
private int color0;
private int color1;
private int color2;
ColorSet()
{
this(0,0,0);
}
/**@param color0 value of attribute color0
* @param color1 value of attribute color1
* @param color2 value of attribute color2
* */
ColorSet(int color0,int color1,int color2)
{
this.color0 = color0;
this.color1 = color1;
this.color2 = color2;
}
/**@return the value of color0*/
public int getColor0()
{
return this.color0;
}
/**@return the value of color1*/
public int getColor1()
{
return this.color1;
}
/**@return the value of color2*/
public int getColor2()
{
return this.color2;
}
public String toString()
{
String s="";
s ="Color0: "+this.color0+"\n"+"Color1: "+this.color1+"\n"+"Color2: "+this.color2+"\n";
return s;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?