Card karte;
Stack <Card> kartenstapel;
public Standard52() {
/** this works*/
this.karte = new Card(Suit.HEARTS,13);
/** this throws a 0-pointer exception when I try to initial*/
this.kartenstapel.addElement(new Card(Suit.HEARTS, 13));
this.kartenstapel.addElement(new Card(Suit.HEARTS, 13));
this.kartenstapel.addElement(new Card(Suit.HEARTS, 13));
this.kartenstapel.addElement(new Card(Suit.HEARTS, 13));
}
Why i get a null pointer exception when i try to inital it. Its more theorie then practice but i do not undersstand my failure maybe some of you can explain me where my mistake is.