The constructor signature is defined as the constructor __________ followed by the __________.

a. name, parameter list
b. name, return type
c. definition, body
d. definition, parameter list
e. header, body

Respuesta :

Answer:

The constructor signature is defined as the constructor name followed by the parameter list.

Explanation:

In object oriented programming, a class constructor is a special method that will run automatically whenever a new object is created from the class. The constructor name is same with the class name. Besides, the class constructor is often used to initialize the attributes with initial values. Those initial values are held by the parameter list of the constructor.

One example of the constructor defined in a Java class is as follows:

// class name

public class BankAccount {

    // attribute names

      private String holder;

      private double amount;

      // constructor name

      public BankAccount(String holder, double amount) // parameter list

     {

               this.holder = holder;

               this.amount = amount

      }

}