Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

Search: 

  Tutorial: Programming: Initials 2

Write a program that asks for a name, including both first and last name, and displays the initials.

Tutorial Details:

New Java features. The purpose of this exercise is to use the if statement as well as more Java String methods.

Input. Ask the user for their first and last name, separated by a blank. Trim blanks from the front and back and save it in a string variable.
Separate names. Use the indexOf() or lastIndexOf() to find the blank separating the names. You can then use substring() to extract the first and last initials and store them in variables.
Single name? If the user entered only one name, you should only produce a single initial. Test the result of indexOf() to see if there was a blank. If there was no blank, you can assume it was a single name.


 

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

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Programming: Initials 2

View Tutorial:
Programming: Initials 2

Related Tutorials:

Displaying 1 - 50 of about 1464 Related Tutorials.

Java: String Exercise 2
Java: String Exercise 2 Java: String Exercise 2 Name ______________________ Assume the following.... 1__________h.length() 2__________h.substring(1) 3__________h.toUpperCase() 4
 
Struts 2 Training
Struts 2 Training, Training for developing applications with Struts 2 Struts 2 Training       ...;       The Struts 2 Training for developing
 
Struts 2 Tutorials for Beginners, Struts 2 Tutorial
Struts 2 Tutorial,Struts2 Examples,Apache Struts 2 Tutorials - Free Java Programming Tutorials Struts 2 Tutorial  ... Struts 2 Tutorial and Online free training helps you learn new elegant Struts 2
 
Struts 2 Login Application
Struts 2 Login,Struts 2 Login Application,Struts 2 Application Struts 2 Login Application      ...;        Developing Struts 2 Login Application
 
Struts 2 datetimepicker Example
Struts 2 datetimepicker,Struts 2 datetimepicker Example,Datetimepicker Struts Struts 2 datetimepicker Example   ... will show you how to develop datetimepicker in struts 2. Struts 2 uses the dojo
 
Introduction to Struts 2 Tags
Struts 2 Tags Struts 2 Tags   ... will introduce you with the tags provided along with Struts 2 framework. It is necessary to understand all the tags provided along with Struts 2 framework
 
Struts 2 Tags Examples
Struts 2 Tags,Struts 2 Tags Reference Struts 2 Tags...;   In this section we are discussing the Struts 2 tags with examples. Struts 2 tags provides easy to use custom tags to help the developers to make GUI
 
Struts 2 IDE
Struts 2 Eclipse Plugin,Struts 2 Eclipse Plugin Example,Eclipse Struts 2 Plugin Struts 2 IDE      ... available to ease the development of Struts 2 Framework based applications
 
Struts 2 Date Examples
Struts 2 Date,Struts 2 Date Examples Struts 2 Date... available in the Struts 2 Framework. After reading the tutorials you will lean how to use date functions provided by Struts 2 Framework. Date Format
 
Struts 2 Date Examples
Struts 2 Date,Struts 2 Date Examples Struts 2 Date... available in the Struts 2 Framework. After reading the tutorials you will lean how to use date functions provided by Struts 2 Framework. Date Format
 
Struts 2 Tutorial
Struts 2 Tutorial,Struts2 Examples,Apache Struts 2 Tutorials - Free Java Programming Tutorials Struts 2 Tutorial  ... Struts 2 Tutorial and Online free training helps you learn new elegant Struts 2
 
Struts 2 Ajax
Struts 2 Ajax Struts 2 Ajax    ... explain you Ajax based development in Struts 2. Struts 2 provides built... to the Struts 2 framework. Ajax allows the developers to develop GUI like web
 
Java Struts 2 Programmer
Java Struts 2 Programmer Java Struts 2 Programmer...;   Position Vacant: Java Struts 2 Programmer ...; MCA  Having good experience in Hibernate and Struts 2 
 
Struts 2 Eclipse Plugin
Struts 2 Eclipse Plugin,Struts 2 Eclipse Plugin Example,Eclipse Struts 2 Plugin Struts 2 Eclipse Plugin    ... the examples and the list of plugins that are available for Struts 2 Development using
 
Struts 2 Format Examples
Struts 2 Format,Struts 2 Format Examples Struts 2... in Struts 2 Framework. Our Struts 2 Format Examples are very easy to grasp and you... with unnecessary code. Struts 2 in-built formatting functionality can save you
 
Struts 2 Features
Struts 2 Features Struts 2 Features   ... of the general features of the current Apache Strut 2 framework are given below... in Strut 2 allow creating dynamic web applications with less number of coding. Not only
 
Struts 2 Downloads
Struts 2 Download,Struts 2 Downloads,Struts 2.0 Download Struts 2 Downloads         ... enterprise web applications. Now Struts 2 is released which is every promising
 
Struts 2 Architecture - Detail information on Struts 2 Architecture
Struts 2 Architecture,Struts Architecture Struts 2...;   Struts and webwork has joined together to develop the Struts 2 Framework. Struts 2 Framework is very extensible and elegant for the development
 
Struts 2 Validation Example
Struts 2 Validation,Struts 2 Validation Example Struts 2 Validation Example         ... you will be able to write validations for your Struts 2 projects. The concepts
 
Struts 2 File Upload
Struts 2 File Upload Struts 2 File Upload...; In this section you will learn how to write program in Struts 2 to upload the file... file in any directory on the server machine. The Struts 2 FileUpload component can
 
Struts 2 Hello World Application Example, Learn how to develop Hello World application in struts 2.
Struts 2 Hello World,Struts Hello World,Developing Hello World Application Struts 2 Hello World - Developing... Hello World application based on Struts 2 Framework. Our Struts 2 Hello
 
We are providing Fedora Cord 2 Linux CD's .
We are providing Fedora Cord 2 Linux CD's . Fedora Core 2 Linux Now Available Fedora Cord2 CD's We are providing the free downloadable version of Fedora Core 2 CDs, which is distributed under GNU public
 
Struts 2 - History of Struts 2
Struts 2 History Struts 2 History   ....  Strut2 contains the combined features of Struts Ti and WebWork 2 projects... of WebWork2 has changed to Struts2. Hence, Apache Strut 2 is a dynamic, extensible
 
Running and Testing Struts 2 Login application
Running Struts 2 Login Example Program Running and Testing Struts 2 Login application       ...;       Running Struts 2 Login Example
 
Struts 2 Date Format Examples
Struts 2 Date Format,Struts 2 Date Format Examples Struts 2 Date Format Examples        ... function in Struts 2. We have provided fully tested example code to illustrate
 
Why Struts 2
New Features of Struts,Features of struts 2,Why Struts 2 Why Struts 2          ... that has been resolved in the struts 2 framework. Most of the Struts 2
 
Why Struts 2
New Features of Struts,Features of struts 2,Why Struts 2 Why Struts 2          ... that has been resolved in the struts 2 framework. Most of the Struts 2
 
String Exercise 2 - Answers
Java: String Exercise 2 - Answers Java: String Exercise 2 - Answers Name ______________________ Assume..."a".compareTo("c") 19> 0"a".compareTo("A") 20ws.trim().charAt(2) Copyleft 2003 Fred
 
Regex Exercises 2
Java: Regex Exercises 2 Java: Regex Exercises 2 Name.... For subject "xa[1] = a[2] + a[3];", group 1 will be "2" on the first match, and "3
 
Struts 2 Resources Examples
Struts2 Actions Struts 2 Resources Examples              ... the request and response object in struts 2 application. 
 
Struts 2 Tags Examples
Struts 2 Tags,Struts 2 Tags Reference Struts 2 Tags...;   In this section we are discussing the Struts 2 tags with examples. Struts 2 tags provides easy to use custom tags to help the developers to make GUI
 
Maven 2 Eclipse Plug-in
Maven 2 Eclipse Plug-in Maven 2 Eclipse Plug... from   http://www.eclipse.org/downloads/ 2. Get Maven-eclipse-plugin... and Install    as shown in Figure 1 below: Figure 1 2.  Choose
 
Text Clock 2
Java: Example - Text Clock 2 Java: Example - Text Clock 2 This is the same as Example - Text Clock... for an explanation of a simple timer class. Main program / Applet 1 2 3 4
 
JPanel - Drawing Area 2
Java: JPanel - Drawing Area 2 Java: JPanel - Drawing Area 2 To initialize the panel -- Constructor You can set the attributes of a panel from method where it's created, but if all
 
Programming: Initials 2
Java: Programming: Initials 2 Java: Programming: Initials 2 Name... and last name, and displays the initials. You should also handle the case when
 
Introduction to Maven 2
Introduction to Maven 2 Introduction to Maven 2            ... but not all plugins that exists for maven1 are ported yet. Maven 2 is expected
 
Download and Installing Struts 2
Struts 2 Download, Download Struts 2, Download Struts 2.0 Download Struts 2.0                      
 
Struts 2 Session Scope
Struts 2 Session,Struts 2 Sessionaware,Struts 2 Session Scope Struts 2 Session Scope       ..."> <struts> <!-- Rose India Struts 2 Tutorials --> <constant
 
Maven 2: Features
Maven 2: Features Maven 2: Features                          
 
J2EE Interview Questions -2
J2EE Questions,J2EE Interview Questions J2EE Interview Questions -2                          
 
SME Server 7.0 Pre 2 has been released now
SME Server 7.0 Pre 2 has been released now SME Server 7.0 Pre 2 has been released now SME Server 7.0 pre-release 2.... Sharing of a single Internet connection between multiple computers 2
 
Collections Exercise 2 - State Capitals
Java: Collections Exercise 2 - State Capitals Java: Collections Exercise 2 - State Capitals Name ____________________________________ For the purposes of this exercise, the only
 
Validations using Struts 2 Annotations
Struts 2 Annotations,Validations using Struts 2 Annotations Validations using Struts 2 Annotations     ...;         Validating Struts 2 Login
 
Java Interview Questions - Page 2
Java Interview Questions,interview questions java Java Interview Questions - Page 2    ...: 1. The Java Virtual Machine (Java VM) 2. The Java
 
Common Interview Questions Page -2
Common Interview Questions Page -2 Common Interview Questions Page -2                     
 
Servlet Interview Questions - Page 2
- Page 2        ... in Initializing a Servlet. 2. The container invokes the service method
 
Difficult Interview Questions Page -2
Difficult Interview Questions Page -2 Difficult Interview Questions Page -2                    
 
NexentaOS Alpha 2 has been released
NexentaOS Alpha 2 has been released NexentaOS Alpha 2 has been released NexentaOS ('elatte') Alpha 2 is now available! The following are the Alpha 2 highlights: new installer (auto-partitioning
 
Fedora Core 5 Test 2 Released
Fedora Core 5 Test 2 Released Fedora Core 5 Test 2... Fedora Core 5 Test 2 binary CD iso images for i386. 3.0GB 2006-01-16 FC5-test2-src-i386.torrent Fedora Core 5 Test 2 source CD iso
 
Client Side validation in Struts 2 application
Client Side validation in Struts 2 application Client Side validation in Struts 2 application     ...;head> <title>Struts 2 Login Application!</title> <
 
Site navigation
 

 

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

Copyright © 2006. All rights reserved.