This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Java array help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java array help" Watch "Java array help" New topic

Java array help

Tracie Marshall

Joined: Jan 24, 2010
Posts: 1
So, I have this code and I have an array of alphabets which I've copied into a new array. No I need to go through the array and print the vowels "a,e,i,o,u" in uppercase. I was wondering if anyone could help me.

Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
I don't really get the sense of it but this should help

first, your array should be of type char and not String...

you can also iterate over the array using the enhanced for loop .

JDBCSupport - An easy to use, light-weight JDBC framework -
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

I don't get it either. Why are you using an arraycopy?
But instead of String.valueOf(c).toUpperCase() I would use Char.toUpperCase(c);

"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Consider Paul's rocket mass heater.
subject: Java array help
Similar Threads
Alphabet Pyramid (this one!)
Need help with an application
Crypto Challenge Instructions
Need some help with output to file