public class CommandLine {
public static void main(String[] args) {
String[] arg;
int x;
x = args.length;
for (int y = 1; y <= x; y++) {
System.out.print(" " + args[y]);
}
}
}
and the command-line invocation,
java CommandLine 1 2 3
class Super {
public final void showSample() {
System.out.println("One");
}
}
class Sub extends Super {
public void showSample() {
System.out.println("Another thing.");
}
}
public static void main(String args[]) throws Exception {
int x = 10;
switch (x) {
case 10:
System.out.println("10");
case 10:
System.out.println("10");
case 20:
System.out.println("20");
default:
System.out.println("30");
}
}
}