public class WUYU{ public static void main(String[] args) { person p= new person(); p.name="张三"; p.age= 18; p.gender = true; System.out.println("姓名;" + p.name + "年龄" + p.age ); eat(); sleep(); } static class person{ String name; int age; boolean gender;} public void eat(){ System.out.println("用嘴吃"); } public void sleep(){ System.out.println("躺着睡"); }}
3 回答
添加回答
举报
0/150
提交
取消