初学java 程序有几个错误,帮忙看看,谢了
importjava.io.*;publicclassTestStudent{publicstaticvoidmain(String[]args){classStuden...
import java.io.*;public class TestStudent{public static void main(String[] args){class Student{String sno;String classno;String name;char sex;int age;Student(String son,String classno,String name,char sex,int age){this.son=sno;this.classno=classno;this.name=name;this.sex=sex;this.age=age;}int getNewAge(){String s="";try{BufferedReader in=new BufferedReader(new InputStreamReader(System.in));s=in.readLine();int a=Integer.parseInt(s);}catch(IOException e){System.out.println(e);}return(a);}}}Student p=new Student("2011121778","class five","a","boy","18");age=getNewAge();System.out.println("you have entered:"+p);}
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询