Question: Anyone can help me in this code to run this?? please send your code. import java.util.LinkedList; import java.util.Collections; import java.util.Iterator; /** * Instances of this

Anyone can help me in this code to run this?? please send your code.

import java.util.LinkedList; import java.util.Collections; import java.util.Iterator; /** * Instances of this class represent a * deck of cards * * @author francis dc * @version 1.1 */ public class Deck { private static final int NUM = 3; // Number of cards in Deck private Card[] cards;

private int squares; public RelativeMovementCard(String description, int squares) { super(description); this.squares = squares; }

private int amount; public PayBankCard(String description, int amount) { super(description); }

public Deck(); { cards = new Card[NUM]; cards[0] = new RelativeMovementCard("Go back 3 spaces", -3); cards[1] = new PayBankCard("Pay poor tax $15", 15); cards[2] = new PayBankCard("Pay school tax of $150", 150); }

public void save() { for (int i = 0; i < cards.length; i++) cards[i].save(); } public void pickCard() { Card card; card = cards[0]; card.execute(); // shuffle the other cards to the front and // add the current card to the end of the deck // }

public static void main(String[] args) { Deck deck; deck = new Deck(); deck.pickCard(); deck.pickCard(); } }

because there are error ni the code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!