public final class SavingsAccount implements Serializable {
/**
* This constructor requires all fields to be passed as parameters.
*
* @param aFirstName contains only letters, spaces, and apostrophes.
* @param aLastName contains only letters, spaces, and apostrophes.
* @param aAccountNumber is non-negative.
* @param aDateOpened has a non-negative number of milliseconds.
*/
public SavingsAccount (
String aFirstName, String aLastName, int aAccountNumber, Date aDateOpened
){
super();
setFirstName(aFirstName);
setLastName(aLastName);
setAccountNumber(aAccountNumber);
//make a defensive copy of the mutable Date passed to the constructor
setDateOpened( new Date(aDateOpened.getTime()) );
//there is no need here to call validateState.
}
public SavingsAccount () {
this ("FirstName", "LastName", 0, new Date(System.currentTimeMillis()));
}
public final String getFirstName() {
return fFirstName;
}
public final String getLastName(){
return fLastName;
}
public final int getAccountNumber() {
return fAccountNumber;
}
The Savings Account constructor in the above snippet has the super() keyword but the class does not extend any super class it just implments the Serializable class?
IS this correct JAVA?