How do you use the switch statement in Java? I'm a complete beginner.
I've worked with Javascript when designing web sites, so I have some very basic programming experience.
How do you use the switch statement in Java? I'm a complete beginner.
I've worked with Javascript when designing web sites, so I have some very basic programming experience.
but when I'm writing codes in this software I feel something similar to JAVA coding
That is because you are writing Java, since BlueJ is nothing that an IDE for Java, not a language. So, answering your question, if you want a switch statement, write a Java switch statement:
switch (variable) {
case option1:
//code
break;
case option2:
//other code
break;
}
Thanks you guys for telling me that BLUEJ is an IDE for JAVA, then I started searching for JAVA switch statement.
I found an article with simple examples that would explain to any beginner like me what is SWITCH statement.
http://www.homeandlearn.co.uk/java/java_switch_statements.html
Thanks everyone for your answers and valuable time.