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

📄 student.java

📁 用java编写的一些初级代码
💻 JAVA
字号:

class Person
{
    public int age ;
    public String name;
    public Person(){}
    public Person(String name,int age){
	this.age=age;
	this.name=name;
    }

    public void getInfo(){
	System.out.println(this.age);
	System.out.println(this.name);
    };
}
public class Student extends Person 
{
    public String school;
    public Student(String name,int age,String school){
	super(name,age);
	this.school=school;
    }
    public void study(){
	System.out.println("studding");
    }; 
    public void getInfo(){
	super.getInfo();
	System.out.println(this.school);
    }
    public static void main (String [] args)
    {
	Person p= new Person("cat",1);
	p.getInfo();
	Student t= new Student("dog",3,"what");
	t.getInfo();
	t.study();
    }
}

⌨️ 快捷键说明

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