?? stu1.java
字號:
public class Stu1 implements Student_info //實現(xiàn)學(xué)生情況接口
{
String name;
int birth_year; //類自己的成員變量
public Stu1(String n1,int y)
{
name = n1;
birth_year = y;
}
public int age() //實現(xiàn)接口的方法
{
return year - birth_year;
}
public void output() //實現(xiàn)接口的方法
{
System.out.println(this.name +" "+ this.age()+"歲");
}
public static void main (String args[])
{
Stu1 s1 = new Stu1("李明",1980);
s1.output();
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -