Search:

Type: Posts; User: aussiemcgr

Search: Search took 0.39 seconds.

  1. Replies
    14
    Views
    1,405

    Re: Class heirarchy

    To answer your question from earlier:

    ChessPiece pawn1Black;
    pawn1Black = new Pawn("BLACK", "PAWN" , 1 , 0);
    OR:

    Pawn pawn1Black;
    pawn1Black = new Pawn("BLACK", "PAWN" , 1 , 0);
    If you are...
  2. Replies
    14
    Views
    1,405

    Re: Class heirarchy

    Pretty much. If you wanted to make ChessPiece abstract, you could do this without actually implementing the methods in the ChessPiece class.
    For example of how abstract and overriding methods work:...
  3. Replies
    14
    Views
    1,405

    Re: Class heirarchy

    Ok, I understand your problem.
    Your ChessPiece array contains implemented subclasses of ChessPiece, but the "type" of the array is ultimately: ChessPiece. This means that the only methods and...
  4. Replies
    14
    Views
    1,405

    Re: Class heirarchy

    Your colleague is suggesting that ChessPiece should be abstract. Abstract classes cannot be initialized, so you cannot create any "ChessPiece" objects. This would be correct, since you don't want...
Results 1 to 4 of 4