package testcode; import java.util.Arrays; public class ForIfCase { static public void main(String[] args) { String res = ""; for (int n = 1; n < 10; n = n + 1) { res = res + Integer.toString(n); switch (n) { case 0: res = res + " "; break; case 1: res = res + "-"; // FALLTHROUGH case 2: case 3: res = res + "%"; break; default: // nothing } if (n > 5) res = res + "*"; } for (String x : Arrays.asList("a", "b", "c")) { res = res + x; } System.out.println(res); } }