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

}

Upcoming Training Events

0 AM
Visual Studio Live! San Diego
September 8-12, 2025
Live! 360 Orlando
November 16-21, 2025
Cloud & Containers Live! Orlando
November 16-21, 2025
Data Platform Live! Orlando
November 16-21, 2025
Visual Studio Live! Orlando
November 16-21, 2025