不写public static void mian(String[] args) Eclipse才会不报错 ,这是为啥子
2016-09-15
public class Telphone{
//属性(成员变量)
double screen;
double cpu;
double mem;
//方法
void call(){
System.out.println("Telphone有打电话的功能!");
System.out.println("Telphone有发短信的功能!");
}
}
//属性(成员变量)
double screen;
double cpu;
double mem;
//方法
void call(){
System.out.println("Telphone有打电话的功能!");
System.out.println("Telphone有发短信的功能!");
}
}
2016-09-13
public class Cell{
int row;
int col;
Cell(int row,int col){
this.row=row;
this.col=col;
}
}
int row;
int col;
Cell(int row,int col){
this.row=row;
this.col=col;
}
}
2016-09-13
思考题解析:
//首先定义一个抽象类Shape
//然后在该类中定义两个抽象方法,一个用来求周长,一个用来求面积
//接下来定义一个Rectanle和Circle类分别用来继承Shape,然后根据实际情况在继承的方法中进行计算即可
//首先定义一个抽象类Shape
//然后在该类中定义两个抽象方法,一个用来求周长,一个用来求面积
//接下来定义一个Rectanle和Circle类分别用来继承Shape,然后根据实际情况在继承的方法中进行计算即可
2016-09-12