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.

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









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
Java class name and file name are different
Java class name and file name are different  Can we run a Java program having class name and file name different?   Hi Friend, No, you can't. It is necessary to save the java file with its class name otherwise
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
"The folder name is not valid" netbeans
"The folder name is not valid" netbeans  "The folder name is not valid" while crating a jsp,html or any page in netbeans
Stoting file name in Map
Stoting file name in Map  how to store id and file name in map
Change the name of the grades
Change the name of the grades  Hi, i'm developing with polar chart and i want to change the name of the grades, for example: add("variable name",5) insted of add(20, 5). Somebody know how to do it? Tanks
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
Altering a Column name in a table
Altering a Column name in a table  how to alter column name in MSSQL server 2005 the codesample given using "change" keyword alter table tablename change oldcolumnname to newcolumnnameADS_TO_REPLACE_1 is not working
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
SQL Alter Column Name
SQL Alter Column Name       Alter Column Name in SQL is used to change or modify the name... The Tutorial explain you a simple example on SQL Alter Column Name
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.
Duplicate name in Manifest - Struts
Duplicate name in Manifest   Hello I'm facing the following error when I run the struts application. Mar 16, 2009 6:05:41 PM java.util.jar.Attributes read WARNING: Duplicate name in Manifest: Depends-On. Ensure
Name Displaying - JSP-Servlet
Name Displaying  Dear Sir, Please any one help me......... when i enter some value in text that value is already in database dispaly the alert...( ); } User Name
Set the mapping name
;  3. Set the mapping name to the action attribute of html.... In such cases, two new action mappings can be created one with ?name' attribute and one without and the same Action class name can be used.  What
Domain Name
The domain name system (DNS) is a series of letters and numbers that are separated by periods and used to name organizations, computers and addresses on the Internet. The domain name is the way that Internet names are located
SQL Alter Column Name
SQL Alter Column Name       Alter Column Name in SQL is used to change or modify the name of column... you a simple example on SQL Alter Column Name. In this Example, create
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
Set the mapping name
;  2. Set the action name to the action attribute...; 3. Either directly use the method name to call as a query string parameter... hidden variable or a query string for mapping the method name to the actual method
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
Java file get name
Java file get name In this section, you will learn how to get the name... the name of the file.ADS_TO_REPLACE_1 Here is the code: import java.io....(); System.out.println("File name is: " + st); } } Through the method getName() of File
Get Property by Name
by Name      ... to get Property by Name. For this we have a class name "Get Property By Name". Inside the main method  we have the list of method that help you
NameError: name 'sc' is not defined
NameError: name 'sc' is not defined - Fixed Beginners finds this error while... the error carefully: NameError: name 'sc' is not defined This is saying that the 'sc... the object in a variable called 'sc'. By default developers are using the name 'sc
personal name aliase from the web
personal name aliase from the web  enter the name to search result in internet connection
Changing column name
Changing column name      ... the name of the column. As this is not the work of the programmer to change the name of the field, but as a programmer we should be aware how we can change
NameError: name 'sc' is not defined
NameError: name 'sc' is not defined - Fixed Beginners finds this error while... the error carefully: NameError: name 'sc' is not definedADS_TO_REPLACE_1... the name 'sc' for SparkContext object, but if you whish you can change
What is domain name and how to get it?
What is domain name and how to get it?  Hi, I am am searching for the information about the domain name. How to get a domain name for my company... is the unique name given to a website on a server. Example of domain name
ModuleNotFoundError: No module named 'micral-name'
ModuleNotFoundError: No module named 'micral-name'  Hi, My Python... 'micral-name' How to remove the ModuleNotFoundError: No module named 'micral-name' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'module_name'
ModuleNotFoundError: No module named 'module_name'  Hi, My Python... 'module_name' How to remove the ModuleNotFoundError: No module named 'module_name' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'name_cgf'
ModuleNotFoundError: No module named 'name_cgf'  Hi, My Python... 'name_cgf' How to remove the ModuleNotFoundError: No module named 'name_cgf... to install padas library. You can install name_cgf python with following
ModuleNotFoundError: No module named 'name_cgf'
ModuleNotFoundError: No module named 'name_cgf'  Hi, My Python... 'name_cgf' How to remove the ModuleNotFoundError: No module named 'name_cgf... to install padas library. You can install name_cgf python with following
ModuleNotFoundError: No module named 'name_cgf'
ModuleNotFoundError: No module named 'name_cgf'  Hi, My Python... 'name_cgf' How to remove the ModuleNotFoundError: No module named 'name_cgf... to install padas library. You can install name_cgf python with following

Ads