2020.7.17

一、今日学习内容

   1、第四章综合实例

 1 package com.wuzy.entity;
 2 public class Person {
 3     private String name;
 4     private int age;
 5     public String getName() {
 6         return name;
 7     }
 8     public void setName(String name) {
 9         this.name=name;
10     }
11     public int getAge() {
12         return age;
13     }
14     public void setAge(int age) {
15         this.age=age;
16     }
17 }
 1 package com.wuzy.service;
 2 import com.wuzy.entity.Person;
 3 public class Service {
 4     public static void main(String[] args) {
 5         Person p=new Person();
 6         p.setName("张无忌");
 7         p.setAge(20);
 8         Person p2=new Person();
 9         p2.setName("伍正云");
10         p2.setAge(30);
11         Person[] ps= {p,p2};
12         for(int i=0;i<ps.length;i++)
13         {
14             System.out.println(ps[i].getName()+","+ps[i].getAge());
15         }
16     }
17 }

        输出结果:张无忌,20

                          伍正云,30

二、今日遇到的问题

    今日复习了第四章的内容,没有遇到问题

三、明日计划

    学习第五章的内容

原文地址:https://www.cnblogs.com/wmdww/p/13333862.html