File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Array & String in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic

Array & String in java

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi every one,
I am just a bigener in the field of java and having a problem that I am trying to solve the following:
1.Check if the first word starts with 'a'
2.Check if the first word starts with a vowel
3.Find the number of words in the String(given in question) starting with a vowel
4.After finding the number of words which starts with a vowel, retrive the found words and store them in an array and print
The first three I have successfully solved which show in the following code but the fourth one I tried my best but failed
I would request to please explain me to how to solve this

[This message has been edited by Cindy Glass (edited October 25, 2001).]
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 986

The code you posted got slightly mangled because the less than, and or greater than, sign in the for loops is read as html. You need to put a space before and after those symbols to not have them interpreted (I think).
For the fourth problem - in the for loop for the third problem you will want to store the words, that have a vowel, in an array or vector. Then go back through that array or vector to print the words out. (Or you can print them out as you find them.)

Please ignore post, I have no idea what I am talking about.
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
We started this conversation here
Please register if you want to ask a question in this forum.

"JavaRanch, where the deer and the Certified play" - David O'Meara
I agree. Here's the link:
subject: Array & String in java
jQuery in Action, 3rd edition