Java PrimerMethod Properties in Java

Listing 4. The method "void component(int, String)" in its final version.

 * Set a name component to a new value.
 * @methodtype set
public void component(int index, String component) throws InvalidIndexException {
	assertIsValidIndex(index); // check whether index is valid
	basicComponent(index, component); // set new value
	notifyListeners(new ComponentChangeEvent(...)); // inform listeners



Sign up for our newsletter.

Terms and Privacy Policy consent

I agree to this site's Privacy Policy.

Upcoming Events