求大神帮忙看看这个程序为什么运行不了,谢谢!!1
天水一墨 2016-10-12 09:17:02 import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public abstract class Person {
public abstract void getInformation();//定义一个抽象方法头
public void main(String[] args){
Student student = new Student();
student.getInformation();
student.getAge();
}
}
interface Interface1{
void getAge();
}
class Student extends Person implements Interface1{
public void getInformation() {
String name;
try{System.out.println("please input name:");
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
name=in.readLine();
System.out.println(name);}catch(Exception e){}
}
public void getAge() {
int age;
try{System.out.println("please input age:");
BufferedReader a = new BufferedReader(new InputStreamReader(System.in));
age=Integer.parseInt(a.readLine());
System.out.println("the age is:"+age);}catch(Exception e){}
}
}