23.11.2014 Views

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

geometric progression is like a general progression, except for the way we<br />

determ<strong>in</strong>e the next value. Hence, Geom Progression is declared as a subclass<br />

of the Progression class. As with the Arith Progression class, the<br />

GeomProgression class <strong>in</strong>herits the fields first <strong>and</strong> cur, <strong>and</strong> the methods<br />

firstValue <strong>and</strong> pr<strong>in</strong>tProgression from Progression.<br />

Code Fragment 2.4:<br />

progressions.<br />

Class for geometric<br />

106

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!