Switch Statement Inside a For LOOP
Here is my code :
public class For_Loop {
public static void main(String[] args) {
for (int x = 10; x <= 20; x++){
switch (x) {
case 10:
System.out.println ("Ten");
break;
case 20:
System.out.println ("Twenty");
break;
default:
System.out.println ("None");
break;
}
}
}
}
What's wrong with this???
No comments:
Post a Comment