Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

Search: 

  Tutorial: Programming: Initials 1

Write a program that asks for names and displays the initials.

Tutorial Details:

Ask the user for their first name. Save it in a string variable.
Ask the user for their last name. Save it in a string variable.
Use the substring() method to get the first characters from both the first and last names. Use the toUpperCase() method to convert them to upper case.
Display the initials to the user.
Discussion
What you need is the first letter of each name. There are two ways to get it.

substring(...). You can use the substring(...) method to get a one-character substring starting at the beginning of the name. You can then concatenate this to the first letter from the other name.


 

Rate Tutorial:
http://www.roseindia.net/java/java-tips/data/strings/q-pr-string-if/q-pr-initials1.shtml

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Programming: Initials 1

View Tutorial:
Programming: Initials 1

Related Tutorials:

Displaying 1 - 50 of about 2456 Related Tutorials.

String Exercises 1 - Answers
Java: String Exercises 1 - Answers Java: String Exercises 1 - Answers Answers to the String Exercises 1. 3 -- s refers to exactly the same string as a. ERROR -- t
 
Simple Linked List Exercise 1
Java: Simple Linked List Exercise 1 Java Notes: Simple Linked List Exercise 1 Name... strings and puts them in a doubly linked list. 1 2 3 4 5 6
 
Common Interview Questions Page -1
Common Interview Questions Page -1 Common Interview Questions Page -1       ...;       Question:1. Tell Me a Little
 
Difficult Interview Questions Page -1
Difficult Interview Questions Page -1 Difficult Interview Questions Page -1       ...;       Question 1: Tell me about yourself
 
String Exercises 1
Java: String Exercises 1 Java: String Exercises 1 Name...() __________ 1 + a __________ a.toUpperCase() __________ "Tomorrow".indexOf
 
Constructor Chaining Exercise 1
Java: Constructor Chaining Exercise 1 Java NotesConstructor Chaining Exercise 1 Name _______________________________ The first line of every constructor must be either
 
Programming: Initials 1
Java: Programming: Initials 1 Java: Programming: Initials 1 Name ________________________________________ Write a program that asks for names and displays the initials. Ask the user
 
New Page 1
one is ${bigFive[0]} The second one is ${bigFive["1"]} EL Operators... = text name = "username"> <br>Address Line 1 : <input type...} <br>Address Line 1: ${paramValues.address[0]} <br>Address Line 2
 
JDO UNPLUGGED - PART 1
. ============================================================================== BOOKS FOR REFERENCE: 1. Java Data Objects (May
 
Buy Fedora Core 3 Test 1 Linux CD's in India.
Buy Fedora Core 3 Test 1 Linux CD's in India. Fedora Core 3 Test 1 Linux Fedora Core 3 Is Available Now Available Fedora... Test 1 Linux CDs, which is distributed under GNU public license. ABOUT FEDORA
 
Collections Exercise 1 - Unique Components
Java: Collections Exercise 1 - Unique Components Java: Collections Exercise 1 - Unique Components Name ____________________________________ For the purposes of this exercise, the only
 
Java Interview Questions - Page 1
Java Interview Questions,interview questions java Java Interview Questions - Page 1     ... value would be variable a because the x is 1 and less than y = 2; the x < y
 
Bayanihan Linux 4 Beta 1 has been released
Bayanihan Linux 4 Beta 1 has been released Bayanihan Linux 4 Beta 1 has been released  Bayanihan Linux 4 Beta 1 is now available... the TechBlitz celebration of Advanced Science and Technology Institute. Feature 1
 
Summary - GUI Layouts 1 - FlowLayout, BorderLayout, GridLayout
Java: Summary - GUI Layouts 1 - FlowLayout, BorderLayout, GridLayout Java: Summary - GUI Layouts 1 - FlowLayout, BorderLayout, GridLayout Set the layout manager for a container p
 
SimplyMEPIS 6.0 Alpha 1 is available now
SimplyMEPIS 6.0 Alpha 1 is available now SimplyMEPIS 6.0 Alpha 1 is available now MEPIS has announced the alpha1 release of SimplyMEPIS 6.0. Alpha1 builds on the 6.0-experimental1 release
 
Core Java Interview Question Page 1
Core Java Interview Question, Interview Question Core Java Interview Question Page 1                  
 
Foresight Desktop Linux 0.9.4 Pre 1 has been released now
Foresight Desktop Linux 0.9.4 Pre 1 has been released now Foresight Desktop Linux 0.9.4 Pre 1 has been released now I am please... GNOME 2.12 as the preferred desktop environment. Feature 1. Beagle beagle
 
LG3D LiveCD 2.4 Test 1 has been relesed now
LG3D LiveCD 2.4 Test 1 has been relesed now LG3D LiveCD 2.4 Test 1 has been relesed now LG3D LiveCD 2.4-test1 available. Note: Release 2.4-test1 is - as the name says - only a testing release. Please
 
RR64 Linux 3.0 Beta 1 has been released
RR64 Linux 3.0 Beta 1 has been released RR64 Linux 3.0 Beta 1 has been released RR64 Linux 3.0b1 (Xgl Beauty). RR64.... Welcome to a new dimension... Features: 1. 2.6.15 Kernel (gentoo
 
VectorLinux 5.1 Live Beta 1 has been released
VectorLinux 5.1 Live Beta 1 has been released VectorLinux 5.1 Live Beta 1 has been released Well here it is. We couldn't let the SOHO people have all the fun, could we? This live CD represents
 
Mysql Not
Not is useful when you a perform Not Operation in SQL. The SQL query returns you 1 and 0,  when !o and !1 are selected in the select query. Understand with Example... is used to return 1 and Query !1 returns you 0 respectively. Query for Mysql
 
Mysql Exists
Exists return you only matches records of table 1 with table2. The unmatchable...(01,'Girish','20000'); Query OK, 1 row affected (0.02 sec) mysql> insert into MyTable values(10,'Komal','20000'); Query OK, 1 row affected (0.01
 
Example - Factorial
!) is the product of all integers up to and including n (1 * 2 * 3 * ... * n). This problem... usage is O(N) instead of O(1). It's more complicated for students.... 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
 
Mysql Date Quarter
from 1 to 4. Understand with Example The Tutorial illustrate an example from... Jan-March 1 April-Jun 2 July-Sept 3 Oct-Dec 4 Query to show Quarter  date range 1 to 4
 
Understanding Common SQL statements
are: 1): Select 2): Insert 3): Update 4... statement has mainly three clauses. 1). Select 2.) From 3... three clauses. 1). Insert: It specifies which table column has
 
Mysql Mod
(a, 3) you get 1 for even numbers and 0 for odd numbers. If you use MOD(a, 2... a | +---------+ | 1 | | 0 | | 23 | | 0 | | 27 | | 29
 
Prime Number in Java
programming tutorial, we will be read how to get prime number between 1 to given... 'for' loop. For loop will start from 1 to entered number. And another loop...;number: ");     for (i=1; i < 
 
Common Component Methods
methods of AWT components are as follow: 1 getLocation() - This method is used
 
Using JSTL For Finding Square
to find out the square of values from 1 to 10. But the approach we are taking... are going to find out the square from 1 to 10 which we will give..." begin="0" end="10" step="1"> <tr><td><c:out value="${x}"/></td
 
JavaScript setDate method
to the date object with an integer value between 1 and 31 that represents day...; will hold any integer values between 1 and 31(inclusive) and is required parameter...; if(dateOfMonth >1 && dateOfMonth <31 ){ alert("Current date
 
Product Components of JDBC
;     JDBC has four Components: 1...-ODBC Bridge. 1. The JDBC API. The JDBC application..., also known as JDBC type 1 driver is a  database driver that utilize
 
JavaScript setUTCDate method
object it sets an integer value between 1 and 31 provided by the user...; if(UTCdateOfMonth >1 && UTCdateOfMonth < 31){ alert("Before...( 'UTCdateValue').value; if(UTCdateOfMonth >1 && UTCdateOfMonth <
 
Validate TextArea
text area in struts 2. A text area contains 1 to 250 characters... application follows the certain steps: Step 1: Create index.jsp...."); if((countSummaryText > 250)) addFieldError("summary1","Brief Summary must be 1
 
Workshop for WebLogic 10.1
less than the #1 Commercial Eclipse-based IDE for BEA WebLogic Service-Oriented
 
JavaScript getUTCDate method
to a date object returns an integer value between 1 and 31 that represents day from
 
Open Source Defination
criteria: 1. Free Redistribution: The license shall not restrict any party
 
WEBSERVICE USING APACHE AXIS - TUTORIAL-2 AXIS FOR EJB-WEBSERVICE (part-5)
had seen parts 1 to 4 of this tutorial on exposing an EJB as XML-Webservice
 
What is GHz?
is the standard unit of measuring frequency and Giga is it?s multiplier of 1 billion... whereas L-band have 1 and 2 GHz. S-band is used in common technologies
 
AgileJ StructureViews
;   AgileJ StructureViews code visualizer for Eclipse is: 1
 
VB and ASP programmers
: 1- 5 Years  Keywords: VB, ASP, Visual Basic, Oracle, SQL
 
Java Programmers with Financial Application
; Experience: 1- 6 Years  Keywords: Java, EJB, ERP, Finance, Struts 2, JSF
 
Java Hibernate 3 Programmer
Graduation Not Required  Experience: 1- 6 Years  Keywords
 
PERL & CGI Programmer
; Experience: 1- 6 Years  Keywords: CGI, CGI Scripting, Web
 
Navigable Map Example
value pair like navMap.put(1, "January"); whereas in NavigableSet we...;String>();     navMap.put(1, "January");  ...=June, 5=May, 4=April, 3=March, 2=February, 1=January} First data: 1
 
J2ME Command Class
, exit and item to the Midlet. And also set the priority for it such as 1...", Command.SCREEN, 1);     back = 
 
Online Marketing and Email Campaign
Specialization  Experience: 1- 6 Years  Keywords: online
 
J2ME Display Size Example
to display the size of the screen. Like a below given image 1, the midlet will print... prompt (image 2).           Image 1 Image 2 To get
 
Tomahawk selectManyMenu tag
; element which contains "multiple" attribute  with size "1"...; is that listbox can be set to any size and menu is always set to size "1"...:som" multiple="multiple" size="1"> <
 
XMLEspresso

 
Java Struts 2 Programmer

 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.