program simple_inheritance use shape_module use circle_module use rectangle_module implicit none type (shape_type) :: vs type (circle_type) :: vc type (rectangle_type) :: vr vs = shape_type(10,20) vc = circle_type(100,200,300) vr = rectangle_type(1000,2000,3000,4000) print *,' get ' print *,' shape ', vs%getx(),' ',vs%gety() print *,' circle ', vc%getx(),' ',vc%gety(),' radius = ',vc%getradius() print *,' rectangle ', vr%getx(),' ',vr%gety(),' width = ',vr%getwidth(),' height ',vr%getheight() print *,' draw ' call vs%draw() call vc%draw() call vr%draw() print *,' set ' call vs%setx(19) call vs%sety(19) call vc%setx(199) call vc%sety(199) call vc%setradius(199) call vr%setx(1999) call vr%sety(1999) call vr%setwidth(1999) call vr%setheight(1999) print *,' draw ' call vs%draw() call vc%draw() call vr%draw() end program simple_inheritance