package cn.ly.Day.seven.fifteen;
public class Demo09StaticStudent {
public static void main(String[] args) {
//首先设置一下教室,这是静态的东西,应该通过类名称进行调用
Student.room="007号教室";
Student one=new Student("七七",20);
System.out.println("one的姓名:"+one.getName());
System.out.println("one的年龄:"+one.getAge());
System.out.println("one的教室:"+Student.room);
//按住alt,可以同时改多行,比如,one的输出语句,复制过去之后,把one改成two
Student two=new Student("洛洛",22);
System.out.println("two的姓名:"+two.getName());
System.out.println("two的年龄:"+two.getAge());
System.out.println("two的教室:"+Student.room);
}
}
图解