reset password
Author Message
msargent
Posts: 519
Posted 19:31 Oct 06, 2015 |

Here's how I would do it: Calling split() on a deck returns one half of a deck. The deck from which split() is called will now be the other half. That is, you take half the cards from one deck, create a Deck object from it, and return it. Take the other half and update the Card array in the first deck to have these left over cards. 

Dipesh
Posts: 9
Posted 19:42 Oct 06, 2015 |

you can take full array of deck, then split it into two different array as a sub array of full deck.

reference link. check the correct mark response .

http://stackoverflow.com/questions/5731042/split-array-into-two-parts-without-for-loop-in-java

msargent
Posts: 519
Posted 20:00 Oct 06, 2015 |

You need to keep a reference to each half somewhere. Each half will be a Deck too. You can use the stuff in the SO post to split the arrays, but you will need Deck objects (not just arrays) for the assignment. 

Last edited by msargent at 20:01 Oct 06, 2015.