import java.io.*;
import java.util.*;
import java.io.IOException;
import java.util.Scanner;
public class Lab
{
public static void main(String[]args)
{
System.out.println("MAIN MENU");
System.out.println("<1> Bahasa Melayu");
System.out.println("<2> English");
System.out.println("<3> Exit");
System.out.println("Your selection (1,2 or 3)?");
Scanner read = new Scanner (System.in);
int selection = read.nextInt();
if(selection == 1)
{ System.out.println("Hello, apa khabar?");
}
else if(selection == 2)
{ System.out.println("Hai, how are you?");
}
else if(selection == 3)
{ System.out.println("System exit...");
System.exit(0);
}
else
{ System.out.println("Invalid selection");
System.out.println("null");
}
System.exit(0);
}
}
i wan to fix the problem is if the user key in alpha like abcdefg, will show string "null".. how to solve it.. thx.. help me..