import java.util.Calendar; public class time { public static void main(String[] args) { Calendar cal = Calendar.getInstance(); int day = cal.get(Calendar.DATE); int month = cal.get(Calendar.MONTH) + 1; int year = cal.get(Calendar.YEAR); int dow = cal…
学生类,电脑类,测试类 学生类:解释都写在注释里面 public class Student { public String name; public int id; public char gender; // 让computer类充当学生类的属性,利用这个变量充当对象来调用类里面的方法和属性 public Computer computer; // public Computer computer=new Computer("DEll"); //这是实例变量可以解决空指针异常的问题…