zoukankan      html  css  js  c++  java
  • 10.23创造人第9次作业

    package cn.wzx.www;
    
    public class Person {
        private int id;
        private String name;
        private int age;
        private String sex;
        public String introduce()
        {
            return  "My id=" + id + ", name=" + name + ", age=" + age + ", sex=" +sex ;
        }
        
        public Person(int id,String name,int age,String sex) {
            // TODO 自动生成的构造函数存根
            this.id=id; 
            this.name=name;
            this.age=age;
            this.sex=sex;
        }
        
        public void setId(int id)
        {
            this.id=id;
        }
        
        public void setName(String name)
        {
            this.name=name;
        }
        
        public void setAge(int age)
        {
            this.age=age;
        }
        public void setSex(String sex)
        {
            this.sex=sex;
        }
        public int getId()
        {
            return this.id;
        }
        public String setName()
        {
            return this.name;
        }
        
        public int setAge()
        {
            return this.age;
        }
        public String setSex()
        {
            return this.sex;
        }
        
    }

    package cn.person.www;
     
    public class Demoperson {
     
        public static void main(String[] args) {
            // TODO Auto-generated method stub
            person p1=new person(001,"刘备",40,"北京");
            person p2=new person(002,"关羽",37,"北京");
            person p3=new person(003,"张飞",45,"北京");
            person p4=new person(004,"诸葛亮",25,"北京");
             
            System.out.println(p1.introduce());
            System.out.println(p2.introduce());
            System.out.println(p3.introduce());
            System.out.println(p4.introduce());
             
        }
     
    }
    
    

    
    
  • 相关阅读:
    keepass口令管理实践
    openssl实践
    Nmap
    SSH
    Wireshark 实践
    网站设计
    python database
    python gui
    Excel数据统计与分析
    2020-2021学期20202401金丁《网络空间安全专业导论》第十三周自学总结
  • 原文地址:https://www.cnblogs.com/kally004/p/7754369.html
Copyright © 2011-2022 走看看