public class A{ public static void main(String args[]){ char c = 'd'; for (int i = 1; i <= 4; i++) { switch (i){ case 1: c = 'a'; System.out.print(c); break; case 2: c = 'b'; System.out.print(c); break; case 3: c = 'c'; System.out.print(c); default: System.out.print("!"); } } } } |