Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

FUCK JAVA

Name: CHUMPY CS STUDENT 2010-12-07 20:53

public class Player extends Piece { ... }
/* ... */
public static Piece inputPiece() { ... }
/* ... */

Player playa = inputPiece();

ChumpyProgram.java:43: incompatible types
found   : Piece
required: Player


So what the fuck is the point of inheritance if you can't do that?

Name: Anonymous 2010-12-07 21:14

>>1
Barring any other mistakes in the code, you have to cast it.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List