/*控制台输出*/
public class control {
int a;
int b;
int c;
public control(int a, int b, int c) {
this.a = a;
this.b = b;
this.c = c;
}
public int getA() {
return a;
}
public void setA(int a) {
this.a = a;
}
public int getB() {
return b;
}
public void setB(int b) {
this.b = b;
}
public int getC() {
return c;
}
public void setC(int c) {
this.c = c;
}
public control() {
}
public void color(){
System.out.print("输出的颜色为"+a+b+c);
}
public class green extends control {
public green(int a, int b, int c) {
super(a, b, c);
}
public green() {
}
public void green(int c) {
if (c == 1) {
System.out.println("红");
} else if (c == 2) {
System.out.println("黄");
JAVA 继承-老虎机
于 2022-10-09 23:21:45 首次发布