public class Saluter{ public static String[] MYSELF = {"Sotos", "Dias", "Hera", "Thor", "Loki", "Anouvis"}; public static void main(String[] args) throws java.io.IOException{ if(args.length == 0) System.out.println("Hail " + MYSELF[0] + "!!!"); else if(args[0].equals("_default")){ System.out.println("Choose among " + MYSELF.length + " deities to salute."); boolean salute=false; while(!salute){ int choice = (int)((char) System.in.read()) - 48; System.in.read(); //Διβάζει το enter System.out.println("Entered " + choice); if(choice >= 0 && choice < MYSELF.length){ System.out.println("Hail " + MYSELF[choice]); salute = true; } else System.out.println("Eisai megalos baglamas telika!!!\nGnwrizoyme mono " + MYSELF.length + " theothtes."); } } else for(String god:args) System.out.println("Hail " + god + "!!!"); } }