public Card getCard(int position)
    {
        /**
         * Gets the card from the specified position in the hand.
         * Null is returned if the position isn't in the hand.
         */
        if(position>=0 && position < hand.size())
        return (Card)hand.removeElementAt(position);
        else
        return null;
    }

error message: return (Card)hand.removeElementAt(position); is highlighted, "inconvertible types"

First of all, the javadoc goes outside the method.

Second I believe that you get the error when you run it?
If it is true, then I think the 'hand' Vector doesn't have inside it objects of type Card. What do you put inside the 'hand' ?

/**
         * Gets the card from the specified position in the hand.
         * Null is returned if the position isn't in the hand.
         */
public Card getCard(int position)
    {
        if(position>=0 && position < hand.size())
        return (Card)hand.removeElementAt(position);
        else
        return null;
    }

This should help you understand how Javadoc comments should be written.

nyeah, but I doubt he's actually trying to write javadoc-comments, otherwise he would mention his params, return and possible exceptions :)

my bet is on javaAddict's solution, go and check what you put in there. it's like the magician who accidently put a piglet in his top-hat. the chances of him pulling out a rabbit are quit slim

This article has been dead for over six months. Start a new discussion instead.