I am looking for a solution in Java, which helps to create switch statements in a switch statements? What I wan to do is a to get something similar to a list of options and when user choose one of them, user will gets more options for selections. Is there any simple way to do this?
For such kind of functionality you need create switch statements pass control to another method that will quick the next menu, manage the input, and then run back to the first switch, which checks the return value from the nested menu if required and redisplay the original menu.
You can do this but I think all in one function will mess up and quite looks like unusual style. In this way menu will fully enclosed in its own functionality, which again makes it easier to debug and will change the order of the menus if that is required in future.
I'd like to include few more information here, nested switch statements are not necessarily a good practice. You'll find more ways of expressing control logic. You should refer several books where you will get many suggestion along with the concern issue.