package com.lovecoding.day11.static01;

public class TestPerson {

    public static void main(String[] args) {

        Person person1 = new Person("鸡哥",24);
        Person person2 = new Person("强哥",26);

        //静态的属性
        //类名.静态属性
        String city1 = Person.city;
        city1 = "北京";
        System.out.println(city1);

        Person.city="上海";
        //可以操作 不建议
        String city2 = person1.city;
        System.out.println(city2);

        String city3 = person2.city;
        System.out.println(city3);

        //一份 被对象共享 优于对象 存到 静态区


    }
}
