By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
461,989 Members | 482 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 461,989 IT Pros & Developers. It's quick & easy.

Switching between strings

P: 9
Hey, i have to write a program in which we will apply the same code to 5 different strings. The thing is were not allowed to write the code more than once, and our output has to be given for each string. Does anyone know how to do this?
Oct 23 '07 #1
Share this Question
Share on Google+
3 Replies

Expert 2.5K+
P: 3,652
Use a function that accepts a String argument?
Oct 23 '07 #2

P: 9
Use a function that accepts a String argument?
I'm just beginning java, i havent learnt anything about string arguments yet, do you know how to do it with loops maybe?
Oct 23 '07 #3

P: 94
Ask user for input.

Capture their input and store it in a string.

Pass the string to a for loop.
Oct 24 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.