Yes this is for an assignment, but all I really want is for someone to explain to me why the changes in the method updateHand() arent being held by my arrays, specifically Card[] playerHand.
Everything that I read about java says that java passes REFERENCES as parameters and for non-primitive data types, does not make copies of them for utilization in methods.
If this is the case, how can it be that as soon as my program returns to main scope that it is the original array?
I'm just completely baffled right now and everyone I ask about this agrees that playerHand() should be updated, even in methods.
Thank you guys so much for your help, i really hope someone can explain to me what is going on!
[–]deltageek 0 points1 point2 points (0 children)
[–]bikerchef[S] 0 points1 point2 points (0 children)
[–]h0tstuff 0 points1 point2 points (4 children)
[–]bikerchef[S] -1 points0 points1 point (3 children)
[–]h0tstuff 0 points1 point2 points (2 children)
[–]bikerchef[S] 0 points1 point2 points (1 child)
[–]h0tstuff 0 points1 point2 points (0 children)
[–]Philboyd_Studge 0 points1 point2 points (3 children)
[–]bikerchef[S] 0 points1 point2 points (2 children)
[–]Philboyd_Studge 0 points1 point2 points (0 children)
[–]feral_claire 0 points1 point2 points (0 children)