Share on Google+Share on Google+

Nishant Jain
full description of program code
1 Answer(s)      6 years and 2 months ago
Posted in : Java Beginners

import java.util.*; class StringExample6 { public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.println("Enter string:"); String str=input.nextLine(); StringTokenizer stk=new StringTokenizer(str); String vowels="",consonants=""; while(stk.hasMoreTokens()){ String token=stk.nextToken(); if(token.startsWith("a")||token.startsWith("e")||token.startsWith("i")||token.startsWith("o")||token.startsWith("u")){ vowels+=token+" "; } else if(!token.startsWith("a")||!token.startsWith("e")||!token.startsWith("i")||!token.startsWith("o")||!token.startsWith("u")){ consonants+=token+" "; } } System.out.println("Second Output: "+vowels.concat(consonants)); } }

above a program code of reverse string program in this program user input a string and print all vowel worts at start and end all consonant. i've a problem that plz describe me full description of this code thanks

Ads

View Answers

February 24, 2011 at 1:06 PM


In the above code, we have used StringTokenizer class that splits the string on the basis of " ".The method hasMoreTokens() of this class searches the words or tokens till the end of the string. The method nextToken() finds the word. If that word or token starts with a or e or i or o or u, then the word will store into the string vowels, otherwise the words will get stored into the string consonants. At last we have concatenated both the strings.










Related Tutorials/Questions & Answers:
full description of program code
full description of program code  import java.util.*; class.... i've a problem that plz describe me full description of this code thanks...(consonants)); } } above a program code of reverse string program in this program
full description of program code
full description of program code  import java.util.*; class...(consonants)); } } Describe me in deeply full detail of above program code how.... This is the full description for your second output
Advertisements
full description of program code
full description of program code  escribe me below code how this program code is make and work, and those method is use in this why? import java.util.*; class SortList { public static void main(String[]args) { Scanner input=new
Description
THIS PROGRAM AND WHATS THE WORKING OF EVERY LOOP   The above code
Description
THIS PROGRAM AND WHATS THE WORKING OF EVERY LOOP   The above code
Description
THIS PROGRAM AND WHATS THE WORKING OF EVERY LOOP   The above code
Description
THIS PROGRAM AND WHATS THE WORKING OF EVERY LOOP   The above code
Download full code of JSF, Spring and Hibernate based Registration program
Download full code of JSF, Spring and Hibernate based Registration program...; From this page you can download the source code of the application. Downloading code Click here to download the code of the application. Extracting
GoogleJsonResponseException code: 400 : The request metadata specifies an invali d video description.
GoogleJsonResponseException code: 400 : The request metadata specifies an invali d video description.  Hi, I have made a Java program to upload... was the description: <int> method in a program..... After removing the <> tags
You asked full source code for search - Development process
You asked full source code for search  Hi, For this code can u give me code for display records when i select any field Search Page var arr = new Array(); arr["Select"] = new Array("-select
code for program
code for program  hello,I am new to java and need to get the code for a program,i've been trying all sorts of code and nothing works any help would be appreciated.Below is what the program should output with the user's input
program code
program code  I need to get the code for the following,the user's input are enclosed in curly brackets,thank you. HARDWARE ITEMS CODE DESCRIPTION... 23} ADDRESS-2: {Building 8} ADDRESS-3: {Winchester} POST CODE: {89763} ENTER
code for a program
code for a program   Write a program which has 2 numbers. There should be an option to add, multiply, divide and subtract these numbers a. If user opts "A" - Add the 2 numbers b. If user opts "S" - Subtract the numbers c
program code
program code  I want a program that accepts a word from TextField and check with multiple .csv file and displays the snippets from csv file into TextArea. Please help me
program code
program code  login and registration form for shopping cart using struts-hibernate with oracle database connection
java code for accept city name and gives temparature,wind speed,humidity exts along with description
java code for accept city name and gives temparature,wind speed,humidity exts along with description  java code for accept city name and gives temparature,wind speed,humidity exts along with description
i need program or code for this program
i need program or code for this program  out should be in this form 1 2 3 4 5 6 3 5 7 9 11 8 12 16 20 20 28 36 48 64 112
full coding
full coding  class IdentifyMyParts { public static int x=7; public int y=3;} IdentifyMyParts a = new IdentifyMyParts(); IdentifyMyParts b = new IdentifyMyParts(); a.y = 5; b.y = 6; a.x = 1; b.x = 2; System.out.println("a.y
program code - JSP-Servlet
program code  what is the program code for LOGINFORM USING SERVLETS? RESPOND SOON
program code - JSP-Servlet
program code  what is the program code for LOGINFORM USING SERVLETS? RESPOND SOON
applet program code - Applet
applet program code  hello sir, i did't get the code for below problem... please help me... 1.An applet program to draw a line graph for y=2x+5.[for suitable values of x & y
decription of program code
decription of program code  Describe me below code how this program code is make and work, and those method is use in this why? import java.util.*; class SortList { public static void main(String[]args) { Scanner input=new
java program code
java program code  can any one write a program (class) which will have two methods Fibonacci and Factorial, which will be a void and a return respectively. i will be glad if it can have a good display results
program code - Java Beginners
program code  Design and write a Java application that takes as input... to either Q or Z. For the two letters, your application should display a message..., This code will be helpful to you in solving your problem. import java.util.
DOJO full form
DOJO full form  what is the full form of dojo
program code for this question - Java Beginners
program code for this question  QUESTION 1: Electricity Bill Tshubang.... Program should send each customer?s bill to a text file whose name is the customers?s... the customer?s account number, full name and their outstanding balance and the message
GIGO Full Form
GIGO Full Form  What is Full form of GIGO?   Garbage In, Garbage Out is a Full Form of GIGO in regards simple principles followed by computers
core java code for following program
core java code for following program  We are hosting the Olympic games. Write a program that will track all the details of this hosting. The program should track the countries and their players along with the games
source code program - Java Beginners
source code program  I need the source code for a program that converts temperatures from celsius to fahrenheit and vice versa, as well as converting kilometers to miles and vice versa using Java "classes".  Hi
program code for this question - Java Beginners
program code for this question  QUESTION 2: Address Information... as an IP lookup tool. The program reads a search phrase (which could either be an IP... file. The program should display the IP address together with all the associated
Small program code - Java Beginners
Small program code  Develop the echo server and the echo client program that display whatever is typed in the server on to the client
Tutorials   
Java Spring Hibernate Struts Training Retrieve database from the table dynamically in jsp from oracle using servlet What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? neo4j-server.properties file location SASLError using PLAIN: not-authorized

Ads

 
Advertisement null

Ads