I am new to using switches (this is my first one I've ever attempted), could somebody please tell me if this is proper/will work? Code:java switch(3) { case 1: if (args.length == 0) { do something; } break; case 2: if (args.length == 1) { do something; } break; case 3: if (args.length > 1) { do something; } break;}
This can explain it much better than I can http://docs.oracle.com/javase/tutorial/java/nutsandbolts/switch.html
Try this : Code: switch(args.length){ case 0://0 args { //... } break; case 1://1 arg { //... } break; default:// > 1 args { //... } break; }