📄 implementinterface.java
字号:
// 程序:接口
// 范例文件:ImplementInterface.java
interface SuperInterface
{
int a = 5;
int b = 10;
}
interface ChildInterface extends SuperInterface
{
int addNumber(int i,int j);
}
public class ImplementInterface implements ChildInterface
{
static int total;
public int addNumber(int i,int j)
{
return i+j;
}
public static void main(String args[])
{
ImplementInterface I = new ImplementInterface();
total = I.addNumber(a,b);
System.out.println("a+b=" + total);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -