Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to avoid multiple if else using design patterns.

843789Aug 9 2009 — edited Aug 12 2009
Hi,
Which design patterns is used to avoid lot of if else in our code . Say for example if the user press 1 the out put should be one, if he press 2 it should be two like this upto 10. So we need to include lot of if-else part. How to avoid the multiple if else using design patter for this scenario. I can't find the solution for this problem can you guys help me?.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 9 2009
Added on Aug 9 2009
20 comments
1,423 views