• 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());
             
        }
     
    }
    
    

    
    
  • 相关阅读:
    scratch第四集——过河孙小弟
    scratch第二集——scratch中的知识帧动画怎么用?
    scratch第九集——雷霆打怪大作战
    scratch第三集——scratch列表方法
    scratch第一集——飞机大作战
    position
    BOM与DOM
    grid布局
    登录界面
    用js输出同样字符出现的次数
  • 原文地址:https://www.cnblogs.com/kally004/p/7754369.html
Copyright © 2020-2023  润新知