Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Faisal Ansari
Name
3 Answer(s)      3 years and 11 months ago
Posted in : Java Beginners


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.


Advertisement
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
Stoting file name in Map
Stoting file name in Map  how to store id and file name in map
"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
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
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
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 newcolumnname is not working
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
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
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
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
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
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
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.
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
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
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 "&
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.
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
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... 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
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
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... the method name to call as a query string parameter, or use an alias. ... the method name to the actual method to call.  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
 

 

 

DMCA.com