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




Have Programming Question? Ask it here!
 
 
 


Faisal Ansari
Names
1 Answer(s)      3 years and 6 months ago
Posted in : Java Beginners


Pl correct this program. This program will take character from user and show all the name which start that character.

import javax.swing.*; class Name1{ public static void main (String arg[]){ char ch; String =JOptionPane.showInputDialog(null,"Enter any character"); switch(ch){ case 1: JOptionPane.showMessageDialog(null,"Ali\n Azam\n Afzal\n"); break; case 2: JOptionPane.showMessageDialog(null,"Babar\n Bebo\n Bell\n"); break; default: JOptionPane.showMessageDialog(null,"Invalid"); } } }


Advertisement
View Answers

February 16, 2011 at 10:42 AM


Display name which starts with particular character

import javax.swing.*;
class Name1{ 
    public static void main (String arg[]){

        String st=JOptionPane.showInputDialog(null,"Enter any character");
        char ch=st.charAt(0);
        switch(ch){
            case 'a': JOptionPane.showMessageDialog(null,"Ali\n Azam\n Afzal\n");
            break;
            case 'b': JOptionPane.showMessageDialog(null,"Babar\n Bebo\n Bell\n");
            break;
            default: 
                JOptionPane.showMessageDialog(null,"Invalid");
            } 
            } 
            }


Related Tutorials/Questions & Answers:
Advertisements
JNDI names in netbeans
JNDI names in netbeans  how to create a JNDI names in netbeans
Java: Names
Java: Names Names should be meaningful and follow conventions Source code..., the names should be meaningful and they should follow the Java conventions for capitalization and use of the underscore. Meaningful names Variables, methods
Identifier Names
Java NotesIdentifier Names Getting the names of things right is extremely.... Digits: 0-9 Special: _ (underscore) No names can be the same as a Java... worse, no distinction made at word boundaries. Class and interface names
Sorting Country names alphabetically
Sorting Country names alphabetically  Hello, I have a list of country names in an array. I need a jsp code which will sort me the country names in an alphaberical order. It would be more useful when I get the coding using
pass parameter names and values
pass parameter names and values  What is the <jsp:param> standard action?   The <jsp:param> standard action is used with <jsp:include> or <jsp:forward> to pass parameter names and values
ipad default image names
ipad default image names  i have a problem while launching application in iPad. The Default image that i have set is not displaying in landscape mode correctly. please suggest. Thanks.   ipad Default image names
Display set names
Display set names  If i enter the First letter of a name it will display the list of names starting with that letter in command prompt using java   import java.util.*; class DisplaySetOfNames{ public static void
Using Unicode Variable Names - Java Tutorials
Using Unicode Variable Names 2001-11-23 The Java Specialists' Newsletter [Issue 036] - Using Unicode Variable Names Author: Dr. Heinz M. Kabutz... Names A few months ago, I was reading a book written by the authors of Java
Class names don't identify a class - Java Tutorials
Class names don't identify a class In JDK 1.2 the Sum Microsystems have added a new feature that allows you to identify a class not only by its name but also by its context for which it was loaded. For this you need to set
Chaldean universal identifications names compiler on the application for Funtepoz
Chaldean universal identifications names compiler on the application for Funtepoz  I want to set up criteria on application table. It is chaldean numerology. I want 30 letters and 4 names in the identification and L and E should
Need to know struts1 all jar file names
Need to know struts1 all jar file names  Hi, My name is Neeraj, I want to know all the jar file names for struts1 and plz provide me the link to download these files. Thanks & Regards Neeraj
Display set of names from array
Display set of names from array In this section, you will learn how to display the set of names from array. In the given code, we have declared an array of string consisting of some countries name. We have prompted the user to enter
SQL All Column Names
SQL All Column Names       SQL All Column Names is useful when you want to see the Field, Type, Null... on 'SQL All Column Names'. To understand and grasp the example we create a table
Chaldean universal identifications names compiler on the application for Funtepoz1
Chaldean universal identifications names compiler on the application for Funtepoz1  In which programme this VBA can be writen: Function Tryme(mycell) mylen = Len(mycell) For j = 1 To mylen mytest = UCase(Mid(mycell, j, 1
Count number of occurences and print names alphabetically in Java
Count number of occurences and print names alphabetically in Java  I have this code: public class Names { public static void main(String[] args) { String[] s = {"bob", "tom", "jim", "tom", "tom", "tim"}; printCount(s); } public
Jdbc Get Column Names
Jdbc Get Column Names       The JDBC Get Column Names return you the property of the retrieved... The Tutorial illustrates an example from JDBC Get Column Names The Program
List the names of classes used to create button and text box in Java.
List the names of classes used to create button and text box in Java.  List the names of classes used to create button and text box in Java
Baby names iPhone, Baby Names Application, Baby name iPhone app, iPhone Baby Names, iPhone baby apps,iPhone baby application
Baby names iPhone - Baby Names Applications for iPhone Baby names iPhone Baby name iPhone app - Search baby names from over 70,000 baby names... the users to search unique and versatile names for their cute and sweet babies
JDBC: Listing Table names Example
JDBC: Listing Table names Example In this section, we are describing how to list all table names of a database using JDBC API. List Tables name in Database : DatabaseMetaData is an interface, implemented by driver which helps user
The query used to display all tables names in SQL Server.
The query used to display all tables names in SQL Server.  What is the query used to display all tables names in SQL Server (Query analyzer
iPhone Baby Name App, iPhone Baby Name, Baby Names application for iPhone
iPhone Baby Name App - World Baby Names... Application containing more than 70,000 baby names... with more than 70,000 names to search from. Use our free iPhone Baby Names
print selected checkbox names in array without form tag
print selected checkbox names in array without form tag  Hi everyone ... I have problem in my program. I have hashmap i.e. collection , my... seleced checked checkbox names, when i click on button but without using FORM tag
Get Column names using Metadata in jsp
Get Column names using Metadata in jsp       This section illustrates you how to get column names... an example that retrieves all column names from a database table student1. Create
Display set of names in array when we press the first letter
Display set of names in array when we press the first letter  Please help to write a program which have to display set of names in the array when we... the available names)using java   Have a look at the following link
Chaldean universal identification names compilator on the applications for Funtepoz civilization
Chaldean universal identification names compilator on the applications for Funtepoz civilization  maybe this code can be converted in any other language except in javascript and VBA: public object Tryme(mycell) { mylen
Get rows count and get columns names
COUNT ROWS AND GET COLUMN NAMES OF A TABLE   In this program , we count the number of data rows stored in a table.  getcolname.java   import java.sql.*; class getcolname  {   public static void main(String[] args
display a list of names(when we press first letter)
display a list of names(when we press first letter)  If i gave 1character the name start wth that characteer has to be displayed... using java   import javax.swing.*; class Name { public static void main (String
Java program to get column names of a table
Java program to get column names of a table... names we need to have connection with the database and then after we will get... of getColumnCount() methods. Now we can get the column names with the index
Getting Column Names from a database table in Java
Getting Column Names from a database table in Java  ..., you need to know the number of columns and the names of the columns...\jdbc-mysql>java ColumnName Getting Column Names Example! Number
How to create a new text file that contains the file names of the copied files in a new directory? - Java Beginners
How to create a new text file that contains the file names of the copied files... file that contains the file names of the copied files in a new directory... text file that has the file names of those files that I copied in a list
find the sql query for the output having two table names ie, homeworklinks,homework_attachments
find the sql query for the output having two table names ie, homeworklinks,homework_attachments  two tables : homeworklinks, homework_attachments homework
Variable Names
Java Notes Variable Names Basic variable naming conventions Choosing good names is probably.... It's worth spending some time to get good names. When I come back to a program of mine
Programming: Flip Names
Java NotesProgramming: Flip Names Name ________________________________________ Write a program that reads a name in first last format and convert... substring(...) to extract the first and last names
Getting Context Parameter Names
Getting Context Parameters NamesGetting Context Parameter Names In this section, you will learn how to get  the context parameters which we have given in the web.xml file. ServletContext is a interface which helps us to communicate
Getting Init Parameter Names
Getting Init Parameter Names       In this example we are going to retreive the init paramater values which we have given in the web.xml file. Whenever the container
Getting Columns Names using Servlets
Getting Columns Names using Servlets   ... helps us to write on the browser. To get a column names from the database... the PreparedStatement object. To get the column names from the database we firstly need
Programming: Initials 1
________________________________________ Write a program that asks for names and displays the initials. Ask the user... the first characters from both the first and last names. Use the toUpperCase... -- processing hundreds of thousands of names, it would be more efficient to use
JDBC: List of Database "schema" Name
are describing how to list database 'schema' names using JDBC API. List... : In this example we are listing the database schema names by using getCatalogs() method... Database Schema names DatabaseMetaData md = con.getMetaData(); rs
java.io.FileFilter
or file names returned by the File listFiles() and list() methods include all...(HTMLfilter); . . . } and similarly for String[] names = f.list(HTMLfilter) which returns an array of strings of the names of the files in the directory
Get XML Elements
Get XML Elements       In this section you will learn to develop a simple java program to get the names...: The following program teaches to parse the elements and retrieve  their names
Velocity Web Edit
Assist  Velocity Variables Names  Velocity Variable Methods... Directives  Style Sheet Class Names * Velocity Outline * HTML/XML
Hibernate Query Language
for the names of the Java Classes and properties. Hibernate Query Language is used
Show Parameter In Servlet
parameter names into the table. The following program uses two methods, which... up all the parameter names via the getParameterNames() method... names for the request as an enumeration of string . getParameterValues
Open Source Bug Trackings
the names Issue Tracker or Ticket System have become more appropriate. BTS may
PHP References Explained
References In PHP: What PHP References are? In PHP references  means to access the same variable by two or more different names. References are not like  C pointers means these are not for storing address or any other pointer
C and C++ books-page4
indices (in a multi-dimensional array, e.g. names[3][0][2]). The first element
 

 

 

DMCA.com