I would say that if it compiles, then it's valid. Did you try to compile it? [Or am I missing something?]

Assuming you are using JDK 1.4, and assuming that "elementAt" is defined in one of the classes in the JDK, a quick search of the API documentation (javadoc), reveals that there is an "elementAt()" method defined for class "java.util.Vector" and "javax.swing.DefaultListModel". Did you try reading the relevant javadoc (assuming it is relevant -- or am I again missing something)?

Hope this helps you.

Good Luck,
Avi.