Deck of Cards

Please please help me..Iīve got stuck, and really bad to. I have tried so many different ways now and really donīt know what to do anymore..

I have an assigment for school, the deadline is very very close, that I need some help with. Here is a copy of it:

Write a class called deckOfCards. The class shall be able to create a deck of cards (52 different cards), shuffle the deck and pull the top card from the deck.

Then write a program that uses the class deckOfCards, for example create an object of the class, shuffle the cards and print out the top card with its suit (spades, hearts, diamonds, clubs) and value (1-13).

You may wish to tell us more on how it's currently not working. Also, could you be a little less "creative" in your code indentation? Your current code is next to impossible to read. Thanks and much luck.

Thanks for reposting the code with decent indentation -- it is now much easier to read!

Your problem may be helped by giving DeckOfCards a toString method. This method will have to iterate through the deck using a for loop and adding the resultant Strings together and returning the long string at the end. Or you can do this by creating a StringBuffer object in the toString method and using its append method in your for loop, then after the for loop completes returning the StringBuffer's string via its toString method.

It is a bit confusing, well all of it actually.
Iīve looked around in my books(and head) and arenīt quite sure how I would go about to create one of these solutions. Perhaps itīs the effect of my looong weekend.