
make a program that take a input from user in alphabet and show all the name of that character
E.g User give character "B".
The program shows all the human names which starts from B.

Java show all names that starts with particular character
The give code takes the input character from the user and show all the names that starts with that character.
class CharacterProgram{
public static void main(String[] args) throws Exception
{
System.out.println("Enter character: ");
int input=System.in.read();
char ch=(char)input;
String names[]={"Angelina","Angel","Astha","Ani","Barabara","Barbie","Bali","Babita","Charlie","Charles"};
for(int i=0;i<names.length;i++){
String st=Character.toString(ch);
if(names[i].startsWith(st)){
System.out.println(names[i]);
}
}
}
}

Dear sir i have learnt JoptionPane, showMessageDialog/inputDialog switch, if else statement, import.javax.swing, integer.parseInt, system.out.println method till now. U used a System.in.read();. please remove it and use these above method which i tell u. And show on Pop up menu through JOptionPane.
I make a simple program but this program is compile and take character from the user but doesnt show the output.

Dear sir this program is not run. Which u made
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.