2020
10-10
10-10
Java生成随机姓名、性别和年龄的实现示例
一、定义实体类Person,封装生成的数据packagenet.dc.test;publicclassPerson{privateStringname;privateStringsex;privateintage;publicStringgetName(){returnname;}publicvoidsetName(Stringname){this.name=name;}publicStringgetSex(){returnsex;}publicvoidsetSex(Stringsex){this.sex=sex;}publicintgetAge(){returnage;}publicvoidsetAge(intage){this.a...
继续阅读 >