Here is my classes.
这是我的课程。
package com.psu.janibot;
public class Janibot implements Runnable {
public void move() {
System.out.println("move");
}
@Override
public void run() {
}
// main method
public static void main(String[] args) {
try {
Janibot janibot = (Janibot) Class.forName("Janitor").newInstance();
janibot.run();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
import com.psu.janibot.Janibot;
public class Janitor extends Janibot {
public void run() {
move();
}
}
package com.psu.janibot;
public class Janitor2 extends Janibot{
public void run() {
move();
}
}
package com.psu