今天直接上强度了,感觉自己真的学废了

今天主要还是理解面向对象,学习封装+构造+this+static关键字+标准javabean+对象数组+继承+方法的重写

个人对象数组之前都还学得还行,但是之后的内容就感觉一知半解的,也不是说没懂,就是感觉懂得很模糊,所以明天需要在复习一下对象数组之后的内容,再重温一下,希望明天能够有更大的收获,今天也算是摆烂的一天了哈哈哈哈

百日大厂计划day04! 大家一起加

package com.study.demo;

public class Demo01Object {
    public static void main(String[] args) {
        Person p1 = new Person();
        System.out.println(p1);
        p1.name = "张三";
        p1.eat();
        System.out.println(p1.name);
        //
        System.out.println("=============");
        //
        new Person().eat();
        Mydate md = new Mydate();
        md.year = 2020;
        md.month = 10;
        md.day = 1;
        System.out.println(md.year + "年" + md.month + "月" + md.day + "日");
        System.out.println("=============");
        Citizen c1 = new Citizen();
        c1.name = "张三";
        c1.cardId = "110101199001011234";
        c1.birthday = new Mydate();
        c1.birthday.year = 1990;
        c1.birthday.month = 1;
        c1.birthday.day = 1;
        System.out.println(c1.name + "的出生日期为:" + c1.birthday.year + "年" + c1.birthday.month + "月" + c1.birthday.day + "日");
    }
}

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐