saw mon wrote:Dear all;Today I have another question for Using == with Integer.
in this example:
output is false.why?x refrence and y refrence point to same object.if so I think is when increase value in one refrence ;another refrence's value will be increased.
Carey Brown wrote:You're welcome Brandon. Nice job of cleanup. If you do come back to refactor this at some point bear in mind Winston's comments about OO design.
Carey Brown wrote:Some comments:
'suits' and 'cards' should be in all upper-case because it's a static final, ie a constant.
Too many static members, they should be non-static fields.
Only use under-scores (_) in constant names. Use camel-case for everything else. Eg change Card_Pool to cardPool.
Variable and method names should start with a lower-case. Eg PlayerTwo, and Start_Game.
Methods that check for the presence of something and returns a boolean usually begin with 'is', eg 'isWar' instead of 'Check_For_War'.
Program to interfaces. Eg use List<String> tempDeck = ArrayList<>();
Used Random class instead of Math.random.
Change randNum = (int)(Math.random()*deck.size()); to randNum = rand.nextInt( deck.size() );
Line 161, variable name of 'i' is usually reserved for integers. Perhaps 's' would be better.