MInner newScore=new MInner();
newScore.getScore();
HelloWorld mo=new HelloWorld();
newScore.getScore();
HelloWorld mo=new HelloWorld();
2018-04-04
//定义一个类
public class ATM{
//属性
string name;
float screen;
int button;
int money(){
System.out.println("请按提示操作,输入密码,输入取款金额");
return money;
}
}
public class ATM{
//属性
string name;
float screen;
int button;
int money(){
System.out.println("请按提示操作,输入密码,输入取款金额");
return money;
}
}
2018-04-04
类是一组具有共同特性的对象成员的集合,它是一个抽象的概念,类是对象的模板,用于创建具有相同属性和相同操作(服务)的对象。它包括属性和方法。
顶我上去,谢谢了!
顶我上去,谢谢了!
2018-04-03
System.out.println("外部类中的name:" +HelloWorld.this.name);
System.out.println("内部类中的name:" +name);
Inner inn =o.new Inner();
System.out.println("内部类中的name:" +name);
Inner inn =o.new Inner();
2018-04-02
public class HelloWorld {
static int score1 = 86;
static int score2 = 92;
public static int sum() {
int sum;
sum=score1+score2;
return sum;
}
public static void main(String[] args) {
int allScore =HelloWorld.sum();
System.out.println("总分:" + allScore);
}
}
static int score1 = 86;
static int score2 = 92;
public static int sum() {
int sum;
sum=score1+score2;
return sum;
}
public static void main(String[] args) {
int allScore =HelloWorld.sum();
System.out.println("总分:" + allScore);
}
}
2018-04-02
public class HelloWorld {
// 定义静态变量,保存班级名称
static String className = "JAVA开发一班";
public static void main(String[] args) {
// 访问静态变量,输出班级名称
System.out.println(HelloWorld.className);
}
}
// 定义静态变量,保存班级名称
static String className = "JAVA开发一班";
public static void main(String[] args) {
// 访问静态变量,输出班级名称
System.out.println(HelloWorld.className);
}
}
2018-04-02