// 创建方法内部类的对象
MInner a = new MInner();
// 调用内部类的方法
int newScore = a.getScore();
System.out.println("姓名:" + name + "\n加分后的成绩:" + newScore);
// 创建外部类的对象
HelloWorld mo = new HelloWorld();
// 调用外部类的方法
mo.show();
MInner a = new MInner();
// 调用内部类的方法
int newScore = a.getScore();
System.out.println("姓名:" + name + "\n加分后的成绩:" + newScore);
// 创建外部类的对象
HelloWorld mo = new HelloWorld();
// 调用外部类的方法
mo.show();
2016-08-29
package com.mooce;
public class Initial {
public static void main(String[] args) {
// TODO Auto-generated method stub
Traffic t1= new Car();
Traffic t2= new Ship();
Traffic t3=new Plane();
t1.runmath();
t2.runmath();
t3.runmath();
}}
public class Initial {
public static void main(String[] args) {
// TODO Auto-generated method stub
Traffic t1= new Car();
Traffic t2= new Ship();
Traffic t3=new Plane();
t1.runmath();
t2.runmath();
t3.runmath();
}}
2016-08-29