nextwe consider the class arithprogressionwhich we present in code fragment this class defines an arithmetic progressionwhere the next value is determined by adding fixed incrementincto the previous value arithprogression inherits fields first and cur and methods firstvalue(and printprogression(nfrom the progression class it adds new fieldincto store the incrementand two constructors for setting the increment finallyit overrides the nextvalue(method to conform to the way we get the next value for an arithmetic progression polymorphism is at work here when progression reference is pointing to an arith progression objectthen it is the arithprogression methods firstvalue(and nextvalue(that will be used this polymorphism is also true inside the inherited version of printprogression( )because the calls to the firstvalue(and nextvalue(methods here are implicit for the "currentobject (called this in java)which in this case will be of the arith progression class example constructors and the keyword this in the definition of the arith progression classwe have added two constructorsa default onewhich takes no parametersand parametric onewhich takes an integer parameter as the increment for the progression the default constructor actually calls the parametric oneusing the keyword this and passing as the value of the increment parameter these two constructors illustrate method overloading (where method name can have multiple versions inside the same class)since method is actually specified by its namethe class of the object that calls itand the types of arguments that are passed to it--its signature in this casethe overloading is for constructors ( default constructor and parametric constructorthe call this( to the parametric constructor as the first statement of the default constructor triggers an exception to the general constructor chaining rule discussed in section namelywhenever the first statement of constructor calls another constructor 'of the same class using the this referencethe superclass constructor is not implicitly called for note that superclass constructor will eventually be called along the chaineither explicitly or implicitly in particularfor our arithprogression classthe default constructor of the superclass (progressionis implicitly called as the first statement of the parametric constructor of arith progression we discuss constructors in more detail in section