Class Customer


  • public class Customer
    extends java.lang.Object
    A simple business object representing a customer of an insurance company.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int age
      The age of the customer.
      protected java.lang.String gender
      The gender of the customer ('male' or 'female').
      protected boolean married
      The marital state of the customer.
      protected java.lang.String name
      The name of the customer.
    • Constructor Summary

      Constructors 
      Constructor Description
      Customer​(java.lang.String name, java.lang.String gender, int age, boolean married)
      Create a new customer with initial values.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isRiskTaking()
      Check if the customer is risk adverse or willing to take risks.
      java.lang.String toString()
      Get a text representation of the customer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • name

        protected java.lang.String name
        The name of the customer.
      • gender

        protected java.lang.String gender
        The gender of the customer ('male' or 'female').
      • age

        protected int age
        The age of the customer.
      • married

        protected boolean married
        The marital state of the customer.
    • Constructor Detail

      • Customer

        public Customer​(java.lang.String name,
                        java.lang.String gender,
                        int age,
                        boolean married)
        Create a new customer with initial values.
    • Method Detail

      • isRiskTaking

        public boolean isRiskTaking()
        Check if the customer is risk adverse or willing to take risks.
      • toString

        public java.lang.String toString()
        Get a text representation of the customer.
        Overrides:
        toString in class java.lang.Object