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




Have Programming Question? Ask it here!
 
 
 


Faisal Ansari
Name
3 Answer(s)      3 years and 6 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
"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
Combine Name
for a first name and one for a last name. When the button is pressed, it formats them in the result field in the standard last name comma first name style..._combine); p.add(new JLabel("Combined Name")); p.add(_combinedName
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
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
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
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  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
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
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
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
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
Programming: Kingdom - Name
Java NotesProgramming: Kingdom - Name Name ______________________________ The Kingdom class should be extended to know its name. There needs to be a way to set the name, get the name, and somewhere to store the name. Indicate your
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
personal name aliase from the web
personal name aliase from the web  enter the name to search result in internet connection
Java file get name
Java file get name In this section, you will learn how to get the name... the name of the file. Here is the code: import java.io.*; public class... name is: " + st); } } Through the method getName() of File class, you can
Programming - Transform Name
Java: Programming - Transform Name Write a program to redisplay a name, possibly transformed This Java program will reformat a user's name. There are two cases that have to be handled: the trivial case of a single name, where
How to register domain name
Domain name registration is the first step to start any website.  Website requires a name to be known and referred to on the web. Domain name... selected domain name before proceeding for domain name registration
Programming - Transform Name - Answer
Java: Programming - Transform Name - Answer Solution to: Write a program to redisplay a name, possibly transformed. This Java program will reformat a user's name from "First Last" to "Last, First". There are two cases
CORE JAVA get middle name
CORE JAVA get middle name  hello sir...how to get middle name using string tokenizer....??? eg..like name ANKIT it will select only K...!!!!   The given code accepts the name from the console and find the middle
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
timezone_name_from_abbr
timezone_name_from_abbr() Function PHP timezone_name_from_abbr function returns the timezone name from abbreviation. It returns timezone name on success or False on failure. Syntax of timezone_name_from_abbr() Function PHP timezone
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
convert string type to mathod name
a string type data to as a method name? For Ex: collTypeCatList = new ArrayList<... java.util.*; class Employee{ public int id; public String name; public String address; public Employee(){} public Employee(int id, String name,String address
Labeling session name .
Labelling session name Setting the variable name to session_name, you can labell the session name.  <?php $name = session_name("ID"); echo "The session name is $name<br />"; ?>
how to use StringTokenizer to retrieve the class name, attributes name and methods name from the Java Source Code
how to use StringTokenizer to retrieve the class name, attributes name and methods name from the Java Source Code  hi, I have done a program whereby... one problem which is retrieve the Class Name, Attributes Name and Methods Names
How to find a servlet object by name?
How to find a servlet object by name?  How can we locate a servlet object in the code by it's object name?   A. In web.xml you map servlet and define url pattern. Now this url-pattern is used for calling servlet. <
Duplicate name in Manifest - JSP-Servlet
Duplicate name in Manifest   Hello, I don't have the classpath variable in the system variables instead I have Path variable. In that path I... WARNING: Duplicate name in Manifest: Depends-On. Ensure that the manifest does
NAME SORTING. . .anyone? - Java Beginners
NAME SORTING. . .anyone?  how can I sort names without using the 'name.sort' method? please help. . .anyone? the program should sort the first three(3) letters of the names tnx java masters out there!! (^_^) cVm  Hi
Get computer name in java
Get computer name in java       We can get the computer name by the java code program. For getting computer name we have used java.net.InetAddress class. We will use static
runtime error:Invalid column name
; } } Console Output: Getting Results! java.sql.SQLException: Invalid column name...(Result.java:9) SQL> desc EMS_Poll; Name..._Topic; Name Null? Type TOPICID
 

 

 

DMCA.com