In this Java programming tutorial for beginners, you will learn about the switch statement. I will provide Java code examples in Eclipse to show you how to create a switch statement. You may pause the tutorial to type out the code or follow along. If you have questions, please leave a comment. Please subscribe to my channel Bootstrap CSS Girl.
Example of a Switch Statement in Java:
switch(value){
case 1: myString = "Hello";
break;
case 2: myString = "World";
break;
default: myString = "Hello World";
break; }
This Java programming tutorial on switch statements is the seventh in my series of Java coding tutorials. More video tutorials can be found on my playlist, java programming tutorials for beginners: https://www.youtube.com/playlist?list=PLcuSDvYLZy6z_f1AIzFgN27b9rBNxbaO6