Name

Ads
 

Name

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.

View Answers

February 10, 2011 at 11:32 AM

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]);
            }
        }
    }
}

February 15, 2011 at 8:22 AM

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.


February 15, 2011 at 8:28 AM

Dear sir this program is not run. Which u made

Ads









Related Tutorials/Questions & Answers:
Name
Name  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
Name unique
Name unique  I want to check whether the value which I give for the name textfield already exists in the database. In case if it exists , it should.... In other words, value for the name should be unique
Advertisements
search for a name
search for a name  Search for a name Write a program to accept an array of names and a name and check whether the name is present in the array. Return the count of occurrence. Use the following array as input {?Dave?, ?Ann
class name
class name  what is the class name of circle.java   how do i complie my jdk file, what happen s if i put in the correct commands and it still does not complie, what do i do next
Person have name field of Name type..??
Person have name field of Name type..??  Person have name field of Name type means i understood to create new Name class with fields firstname... name? can you please write code two two different class and show me how to use
Stoting file name in Map
Stoting file name in Map  how to store id and file name in map
SQL Alter Column Name
SQL Alter Column Name       Alter Column Name in SQL is used to change or modify the name... a simple example on SQL Alter Column Name. In this Example, create
NameError: name 'SparkConf' is not defined
NameError: name 'SparkConf' is not defined  Hi, What is solution of the error: NameError: name 'SparkConf' is not defined Thanks   Hi, You should import following line: from pyspark import SparkConf, SparkContext
NameError: name 'SparkConf' is not defined
NameError: name 'SparkConf' is not defined  Hi, What is solution of the error: NameError: name 'SparkConf' is not defined Thanks   Hi, You should import following line: from pyspark import SparkConf, SparkContext
Java Program MY NAME
Java Program MY NAME   Write a class that displays your first name... with the following name (for example, for letter A, public displayLetterA... in the correct order to display your name
tag name in xml
tag name in xml  How to get tag name in xml?   <?xml...="http://www.w3.org/1999/XSL/Transform"> <xsl:variable name="outermostElementName" select="name(/*)" /> <xsl:template match="/"> <xsl
personal name aliases
personal name aliases  name to enter.but search in internet connection   Please visit the following links: http://www.roseindia.net/servlets/search.shtml http://www.roseindia.net/answers/viewqa/JSP
personal name aliases
personal name aliases  enter the name search result in internet connection using java code   Please visit the following links: http://www.roseindia.net/servlets/search.shtml http://www.roseindia.net/answers/viewqa/JSP
NameError: name 'np' is not defined
NameError: name 'np' is not defined  Hi, In my python program following error is coming: NameError: name 'np' is not defined How to solve this? Thanks   Hi, This error is coming because you have not imported
NameError: name 'metrics' is not defined
NameError: name 'metrics' is not defined  Hi, In one of my machine learning code following error is coming: NameError: name 'metrics' is not defined How to solve this? Thanks   Hi, You should import following
Impact on change of table name
the table name. If there are dependencies or anything else related to the table... Alwala   Use the given query to change the table name. RENAME TABLE.... Only the table name will get changed
name of year in chinese
name of year in chinese   hello my name kiemtheng i'm come from Cambodia, i would to write java programming to calculate a name of year for each birthday in Chinese but i dont know how to do.   import java.util.
My name, java project
My name, java project  Write a class that displays your first name vertically down the screen ?? where each letter uses up to 5 rows by 5 columns... that letter in a method with the following name (for example, for letter A, public
My name, java project
My name, java project  Write a class that displays your first name vertically down the screen ?? where each letter uses up to 5 rows by 5 columns... that letter in a method with the following name (for example, for letter A, public
display the employee name
display the employee name  when i will select one employee designation based on that employee designation display the particular designation employee name display in another select box how it possible using servlet and mysql
NameError: name 'false' is not defined
NameError: name 'false' is not defined  Hi, My code is giving NameError: name 'false' is not defined. My code is below: if(filename.endswith(".txt") == true): print("Text file") How to solve? Thanks   HI, You
property name= hibernate.archive.autodetection
property name= hibernate.archive.autodetection  Hi, How to set the property name= hibernate.archive.autodetection in my Hibernate project. Can...;property name="hibernate.archive.autodetection" value="class, hbm"/> You
docker remove image by name
docker and trying some images. I want to delete an image by name or id. How to remove image by name or id in docker with command? What is command for docker removing image by name/id? Thanks   Hi. First of all you get the list
parser error xmlparseentityref no name
parser error xmlparseentityref no name  While parsing the error in my mobile application ..i'm getting the following error.. "parser error xmlparseentityref no name" and that is because of "&". I have also tried the "&
No SDK with the name or path
No SDK with the name or path  When i run any downloaded application on my mac professional ..it always returns a message no sdk with the name... Missing or No SDK with the name or path for XYZ version follow the steps below
name of year in chinese
name of year in chinese   hello my name kiemtheng i'm come from Cambodia, i would to write java programming to calculate a name of year for each birthday in Chinese but i dont know how to do.   import java.util.
SQL Alter Column Name
SQL Alter Column Name       Alter Column Name in SQL is used to change or modify the name of column... example on SQL Alter Column Name. In this Example, create a table 'Stu_Table
How to extract name,surname, doamin name from mailid
How to extract name,surname, doamin name from mailid  Hi sir How to extract name,surname, doamin name from mailid using java coding? for example, i want to extract first name as swamy, surname as nandha and domain
Set the mapping name
;  3. Set the mapping name to the action attribute of html... action mappings can be created one with ?name' attribute and one without and the same Action class name can be used.  What are the disadvantages
personal name aliase from the web
personal name aliase from the web  enter the name to search result in internet connection
SQL Alter Table Name
SQL Alter Table Name       SQL Alter Table Name is used to change or modify  name of the existing table. To understand how to change the name of created table in SQL

Ads