⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testinterface.java

📁 一个显示汽车油量的JAVA小程序
💻 JAVA
字号:
import java.io.*;
interface CLASS{
   void display();
}
 class notice implements CLASS{//通知内容
 public void display(){
   System.out.println("Notice content");
}
}
class car implements CLASS{//汽车油量
public void display(){
   System.out.println("car gas");
}
}
class advertisement implements CLASS{//广告消息
public void display(){
   System.out.println("advertisement massage");
}
}
public class TestInterface{
  public static void main(String[] args){
 CLASS []ss={new notice(),new car(),new advertisement()};
  for(int i=0;i<ss.length;i++){
  ss[i].display();
     }
}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -