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

📄 teststatic.java

📁 有一个接口,用抽象类实现它的部分功能,再用实现类继承抽象类,实现其它没实现的接口方法
💻 JAVA
字号:
package cn.edu.csu.oo.staticoper;

public class TestStatic {
  public static int count = 0;
  public int i = 10;
  public TestStatic(){
    count++;
  }
  public static int getTotalCount(){
    
    return count;
  }
  /**
   * @param args
   */
  public static void main(String[] args) {
  
    @SuppressWarnings("unused") 
    TestStatic ts1 = new TestStatic();
    TestStatic ts2 = new TestStatic();
    TestStatic ts3 = new TestStatic();
    
    System.out.println(ts3.count);
    System.out.println(count);
    System.out.println(getTotalCount());
//    System.out.println(i);
  }

}

⌨️ 快捷键说明

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