Class Customer

java.lang.Object
trial.gaurav.customer.Customer

public class Customer extends Object
The `Customer` class represents a customer with a unique ID, a name, and an age.
  • Field Details

    • customerId

      private int customerId
    • customerName

      private String customerName
    • customerAge

      private int customerAge
  • Constructor Details

    • Customer

      public Customer(int id, String name, int age)
      Constructs a new `Customer` object with the given ID, name, and age.
      Parameters:
      id - The unique ID of the customer.
      name - The name of the customer.
      age - The age of the customer.
  • Method Details

    • getCustomerId

      public int getCustomerId()
      Gets the ID of the customer.
      Returns:
      The customer ID.
    • setCustomerId

      public void setCustomerId(int customerId)
      Sets the ID of the customer.
      Parameters:
      customerId - The customer ID to be set.
    • getCustomerName

      public String getCustomerName()
      Gets the name of the customer.
      Returns:
      The customer's name.
    • setCustomerName

      public void setCustomerName(String customerName)
      Sets the name of the customer.
      Parameters:
      customerName - The customer's name to be set.
    • getCustomerAge

      public int getCustomerAge()
      Gets the age of the customer.
      Returns:
      The customer's age.
    • setCustomerAge

      public void setCustomerAge(int customerAge)
      Sets the age of the customer.
      Parameters:
      customerAge - The customer's age to be set.
    • equals

      public boolean equals(int id)
      Checks if the customer's ID equals the specified ID.
      Parameters:
      id - The ID to compare with the customer's ID.
      Returns:
      True if the customer's ID equals the specified ID, otherwise false.