Creating Objects

Posted by user1424667 on Programmers See other posts from Programmers or by user1424667
Published on 2012-06-03T18:32:21Z Indexed on 2012/06/03 22:47 UTC
Read the original article Hit count: 208

I have a general coding standard question. Is it bad practice to initialize and create an object in multiple methods depending on the outcome of a users choice. So for example if the user quits a poker game, create the poker hand with the cards the user has received, even if < 5, and if the user played till the end create object to show completed hand to show outcome of the game. The key is that the object will only be created once in actuality, there are just different paths and parameters is will receive depending on if the user folded, or played on to the showdown.

© Programmers or respective owner

Related posts about java

Related posts about design