?? stu2.java
字號:
public class Stu2 implements Student_info, Student_scoure
{ //實現學生情況接口、學生成績接口
String name;
int birth_year;
float math,english,computer;
public Stu2(String n1,int y,float a,float b,float c)
{
name = n1;
birth_year = y;
math = a;
english = b;
computer = c;
}
public int age()
{
return year - birth_year;
}
public float total()
{
return math + english + computer;
}
public void output() //實現接口的方法
{
System.out.print(this.name +" "+ this.age()+"歲 ");
System.out.println(math +" "+ english +" "+ computer +" "+ total());
}
public static void main (String args[])
{
Stu2 s2 = new Stu2("李明",1980,90,80,70);
s2.output();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -