Subclass a Java class

  1. Implement a Jython class that is a subclass of the Java Vector class: java.util.Vector. A Java Vector is quite similar to a Jython list, but the interface is different.

  2. Implement the following methods in your subclass:

    • upperElementAt(index) -- Return the string at position index converted to upper case.
    • elementAt(index) -- Return the string at position index enclosed in square brackets.

    Assume that only strings will be added to your Vector subclass.

  3. Additional work -- Override the constructor and the add method. Test to make sure that the items added to the vector are strings. Raise an exception if they are not.

What you will learn:

Additional information