package mianxiangduixiangren;
public class Person {
private String name;
private int age;
private char sex;
public static void main(String[] args) {Person p1 = new Person( ) ; //声明并实例化一Person对象p1
Person p2 = new Person( ) ; //声明并实例化一Person对象p2
// 给p1的属性赋值
p1.name = "张三" ;
p1.age = 25 ;
p1.sex='m';
// 给p2的属性赋值
p2.name = "李四" ;
p2.age = 30 ;
p2.sex='w';
System.out.println("我是:"+p1.name+",性别:"+p1.sex+",今年:"+p1.age+"岁");
System.out.println("我是:"+p2.name+",性别:"+p2.sex+",今年:"+p2.age+"岁");
// TODO 自动生成的方法存根
}