Description
Homework 6 Question 1 For the class, |
public class Student { private int id; private String name; private double gpa; private Date dateOfBirth; } |
Write Custom Sorting by implementing the following comparators
Then in the main method, create a List of Student objects and print the list of objects 3 times with the following logic. 1. Sort by ascending order of ‘name’ Question 2 Write a class called 'DrivingLicenseApplication' to read input from the keyboard which take dateOfBirth of Date datatype. If the age is below 16 (For example 14), then throw and catch and exception which prints the message. |
The age of the applicant is 14 which is too early to apply for a driving license |