I'm new to this website so could everyone please forgive me if I'm posting in the wrong section but I really need help. I need to know What is a switch? And can someone please discuss why/when we use switch in Java?
I'm new to this website so could everyone please forgive me if I'm posting in the wrong section but I really need help. I need to know What is a switch? And can someone please discuss why/when we use switch in Java?
If you are using the Boolean value then you will be only able to choose one of two sections of code fro execution. But this is just for two possibility. With the switch statement, you will be able to select as of many statements and this selection will be done on the basis of the integer (including char) or enum value. Just prefer "Complete Reference of JAVA" and you will get that in detail.
Thank you so much for your help.
you can also refer this link to know more about the uses and syntex of this switch statement.
How to use switch statement in java
May this link provide you some more guidance about this switch statement in java
Bookmarks