Completing the Constructor

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to previous page   go to home page   go to next page

Answer:

CheckingAccount( String accNumber, String holder, int start )
{
  initialization of data
}

Since parameters are used only inside the constructor, they often have shorter, less descriptive names than the names given to more permanent data.

Completing the Constructor

So far, the class looks like this:

class CheckingAccount
{
  // instance variables
  String accountNumber;
  String accountHolder;
  int    balance;

  //constructors
  CheckingAccount( String accNumber, String holder, int start )
  {
     =  ;

     =  ;

     =  ;

  }

   methods

}

Next, complete the constructor with three statements that initialize the object's data.

QUESTION 7:

Complete the constructor.