package com.hnsw.demo; public class Person { String name; String sex; int age; double weight; String address; public void Persinnel(){ System.out.println("我是:" + name + ",性别" + sex + ",年龄" + age + ",体重" + weight + ",地址" + address); } public static void main(String[] args) { Person a = new Person(); a.name = "张三"; a.sex = "男"; a.age = 25; a.weight = 98.5; a.address = "湖南长沙"; a.Persinnel(); Person b; b = a; b.name = "张四"; b.sex = "女"; a.address = "湖南娄底"; b.Persinnel(); } }