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

📄 group5.java

📁 Java基础教程课程中的例题源码下载。总共有11章
💻 JAVA
字号:
public class Group5
{
    public interface Student_info                  //内部接口
    {
        public void output();
    }
    public class Student implements Student_info   //内部类实现内部接口
    {
        int count;
        String name;
        public Student(String n1)
        {
            name = n1;
            count++;
        }
        public void output()                       //实现接口方法
        {
            System.out.println(this.name +"  count="+this.count);
        }
    }
    public Group5(String name1[])
    {
        Student s1;
        int i=0;
        while (i<name1.length)
        {
            s1 = new Student(name1[i]);
            s1.output();
            i++;
        }
    }
    public static void main (String args[])
    {
        Group5 g5;
        if (args.length>0)
            g5 = new Group5(args);
    }
}

⌨️ 快捷键说明

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