关于java的学生类信息
package gh;
class xs{
//成员变量
int xh;
String xm;
int sx;
int yw;
int yy;
//构造方法
xs(int xh1,String xm1,int sx1,int yw1,int yy1)
{
xh=xh1;
xm=xm1;
sx=sx1;
yw=yw1;
yy=yy1;
}
//成员方法
int ave()
{
int result;
result = (sx+yw+yy)/3;
return result;
}
}
class xsgj {
public static void main(String[] args) {
// TODO Auto-generated method stub
int avescore;
xs xs1 = new xs(119509228,"周月",100,90,89);
avescore=xs1.ave();
System.out.println("平均成绩"+avescore);
}
}

浙公网安备 33010602011771号