zoukankan      html  css  js  c++  java
  • 10.23创造人

    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.wzx.www;
    
    public class DemoPerson {
    
        public static void main(String[] args) {
            // TODO 自动生成的方法存根
            Person p1=new Person(163600,"张三",20,"男");
            Person p2=new Person(163600,"李四",30,"男");
            Person p3=new Person(163600,"王二麻子",40,"男");
            Person p4=new Person(163600,"陈八婆",50,"女");
            p1.setAge(40);
            shuchu(p1.introduce());
            shuchu(p2.introduce());
            shuchu(p3.introduce());
            shuchu(p4.introduce());
        }
        
        public static void shuchu(String vhat)
        {
            System.out.println(vhat);
        }
    
    }

  • 相关阅读:
    Error in as.POSIXlt.character(x, tz, ...) :
    java.util.ResourceBundle使用详解
    互联网网站的反爬虫策略浅析
    基于内容的图片检索CBIR(Content Based Image Retrieval)简介
    solr
    ETL
    cv 论文(CNN相关)
    输出字符串
    Minimum_Window_Substring两种方法求解
    C++primer中的TextQuery(读取文本)
  • 原文地址:https://www.cnblogs.com/jasonzj/p/7726022.html
Copyright © 2011-2022 走看看