Cs 110 Analysis Questions

Embed Size (px)

DESCRIPTION

Cs Analysis

Citation preview

Cody MosblechComp Sci 110 Analysis Questions 1

How does the javadoc documentation for the constructor and method in the NormalClassTemplate class correspond to the contents of its class documentation page?Also, what effect do the Javadoc @param and @return tags have?

The class documentation gives the constructor and method names and any /** comments in the summary section, and then formats them nicely and with more detail as to their function in the details section. The details section includes details given by the author by using an @param and @return to indicate what the method takes for parameters and what it returns.

Why do you think the AquaFish and AquaSimGUI constructors ask for the aquarium as a parameter?

It's probably possible to create multiple aquarium objects. In that case, the fish and GUI need to know which object they are associated with.

Why does the Aquarium "add" method take a parameter but the AquaFish "moveForward" method and the AquaSimGUI "showAquarium" methods do not?

The 'add' method needs more information before it can do what it needs to do (which fish it's going to add). The 'moveForward' and 'showAquarium' methods are fixed, as in they do the same thing every time, and don't rely on extra parameters.

What happens when you move a fish forward a number of times in a tall, thin aquarium? (This will be the focus of a future lab exercise.)

It reaches the end of the aquarium display and refuses to move forward anymore.