go to previous page   go to home page   go to next page

Answer:

No.


The public Visibility Modifier

The private visibility modifier keeps outsiders from looking in. However, the methods intended for outsiders must be visible to outsiders. Use the public access modifier for them.

Here is a skeleton of the CheckingAccount class:


public class CheckingAccount
{
  private String accountNumber;
  private String accountHolder;
  private int    balance;
  private int    useCount = 0;

  CheckingAccount( String accNumber, String holder, int start ) { . . . . }
  
  void incrementUse() { . . . . }
  
  int getBalance() { . . . . }
  
  void  processDeposit( int amount ) { . . . . }
  
  void processCheck( int amount ) { . . . . }
  
}

QUESTION 11:

Pick a visibility modifier for the constructor and for each of the methods.


go to previous page   go to home page   go to next page