zoukankan      html  css  js  c++  java
  • people 0919

    package liu0919;
    
    public class People
    {
    	private double height;// 身高
    	private String name;// 名字
    	private int age;//年龄
    	private String sex;//性别
    	
    	//成员方法
    	public double getHeight() {
    		return height;
    	}
    	public void setHeight(double height) {
    		this.height = height;
    	}
    	public String getName() {
    		return name;
    	}
    	public void setName(String name) {
    		this.name = name;
    	}
    	public int getAge() {
    		return age;
    	}
    	public void setAge(int age) {
    		this.age = age;
    	}
    	public String getSex() {
    		return sex;
    	}
    	public void setSex(String sex) {
    		this.sex = sex;
    	}
    	
    	public String xingwei(String xw)
    	{
    		return xw;
    	}
    	public int Jia(int a,int b)
    	{
    		return a+b;
    	}
    	public String Gaiming(String gm)
    	{
    		return gm;
    	}
    }
    

      

    package liu0919;
    
    public class Cishi_people {
    
    	public static void main(String[] args) {
    		People pe=new People();
    		pe.setName("张三");
    		System.out.println("姓名是:"+pe.getName());
    		
    		pe.setSex("男");
    		System.out.println("性别是:"+pe.getSex());
    		
    		pe.setAge(18);
    		System.out.println("年龄是:"+pe.getAge());
    		
    		pe.setHeight(1.80);
    		System.out.println("身高是:"+pe.getHeight());
    		
    		System.out.println("说出:"+pe.xingwei("你好!"));
    		
    		System.out.println("23+45="+pe.Jia(23, 45));
    		
    		System.out.println("姓名改为:"+pe.Gaiming("李四"));
    
    	}
    
    }
    

      

  • 相关阅读:
    【转载】python_logging模块
    python安装模块速度慢的解决方法
    2020软件工程作业00
    2020软件工程个人作业——软件工程实践总结
    2020软件工程作业05
    2020软件工程作业04
    2020软件工程作业03
    2020软件工程作业02
    2020软件工程作业01
    列表、元组、集合和字典区别
  • 原文地址:https://www.cnblogs.com/liuyanzeng/p/5886236.html
Copyright © 2011-2022 走看看