Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Lesson 33 Coding Activity 1
- Write a method that takes an array of Strings and changes the Strings to UPPER CASE.
- This method must be called upper() and it must take a String[] parameter.
- */
- import java.util.Scanner;
- class Lesson_33_Activity_One {
- public static void upper(String cas[])
- {
- for(int i = 0; i < cas.length; i++)
- {
- cas[i] = cas[i].toUpperCase();
- }
- }
- public static void main(String[] args)
- {
- String test[] = {"hi","hello","mean","yo","apple","Mac"};
- upper(test);
- for (int i = 0; i < test.length; i++)
- {
- System.out.println(test[i] + " ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement