A good answer might be:

  1. The first      call calls the first      processDeposit() method.   TRUE
  2. The first      call calls the second processDeposit() method.   FALSE
  3. The second call calls the first      processDeposit() method.   FALSE
  4. The second call calls the second processDeposit() method.   TRUE

Method Signature

When several methods have the same name, which method is required by the call is easy to determine:

The method to use is the one with formal parameters that match the actual parameters in the call.

For example, the call

    bobsAccount.processDeposit( 200, 25 );       // first call

matched this method declaration:

  void  processDeposit( int amount, int serviceCharge )

because the number and types of the actual parameters matches the number and types of the formal paramters.

The signature of a method is:

  • Its name.
  • The number and types of its parameters, in order.

The signatures of the methods in a class must be unique. For example, the signatures of the two processDeposit methods are:

  • processDeposit( int )
  • processDeposit( int, int )
Notice that the return type is not part of the signature, and that the identifiers used for the formal parameters are not part of the signature.

QUESTION 13:

A class has the following two methods:

float chargePenalty( int amount  ) { ... }
int   chargePenalty( int penalty ) { ... }
Do these methods have unique siqnatures?

Click Here after you have answered the question