-
Language:
English
-
Language:
English
22.9. Banking Example: Class SimpleDate
public class SimpleDate extends Date {
private static final SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
public SimpleDate(String datestr) throws Exception {
setTime(format.parse(datestr).getTime());
}
}- The convenience class
SimpleDateextendsjava.util.Date, providing a constructor taking a String as input and defining a date format.