inheritance diagram for class progression and its subclasses to complete our examplewe define class testprogressionshown in code fragment which performs simple test of each of the three classes in this classvariable prog is polymorphic during the execution of the main methodsince it references objects of class arithprogressiongeomprogressionand fibonacciprogression in turn when the main method of the testprogression class is invoked by the java run-time systemthe output shown in code fragment is produced the example presented in this section is admittedly smallbut it provides simple illustration of inheritance in java the progression classits subclassesand the tester program have number of shortcomingshoweverwhich might not be immediately apparent one problem is that the geometric and fibonacci progressions grow quicklyand there is no provision for handling the inevitable overflow of the long integers involved for examplesince geometric progression with base will overflow long integer after iterations likewisethe th fibonacci number is greater than hencethe fibonacci progression will overflow long integer after iterations another problem is that we may not allow arbitrary starting values for fibonacci progression for exampledo we allow fibonacci progression starting with and - dealing with input errors or error conditions that occur during the running of java program requires that we have some mechanism for handling them we discuss this topic next