创建包 exercise1, 根据下面 UML 图,写出两个类: Address 和 Student ,然后将主类 StudentBody 复制到包中,阅读代码,执行程序。 • Address 类的 4个域分别表示 :省、市、地址、邮编; • Address 类的 toString() 方法:返回“省市地址,邮编” • Student 类的域 NUM_TESTS ,是常量,值为 3. • Student 类的构造方法为 name 、 homeAddress 和 SchoolAddress 赋值,并且为 test1 、 test2 、 test3 赋初始值 0 • Student 类的 toString() 方法:返回“姓名 \n 家庭地址 \n 学校地址 \n 成绩 1 \n 成绩 2 \n 成绩 3 \n 平均成绩” • 读主类 StudentBody 代码,执行主类,观察结果。 public class StudentBody{ public static void main (String[] args) { Address school = new Address ("浙江", "杭州", "教工路124号", 110035); Address jHome = new Address ("浙江", "宁波","河滨路120号", 120001); Student wangping = new Student ("", jHome, school); Address mHome = new Address ("江苏", "南京", "中山路14号",44132); Student zhaoxiaolan = new Student ("", mHome, school); System.out.println (wangping); System.out.println (zhaoxiaolan); wangping.setTestScore(1, 78); wangping.setTestScore(2, 92); wangping.setTestScore(3, 80); zhaoxiaolan.setTestScore(1, 89); zhaoxiaolan.setTestScore(2, 83); zhaoxiaolan.setTestScore(3, 94); System.out.println("wangping's score on test 1: " + wangping.getTestScore(1)); System.out.println("zhaoxiaolan's score on test 2: " + zhaoxiaolan.getTestScore(2)); System.out.println (); System.out.println (wangping); System.out.println (zhaoxiaolan); } }