Java examples for Object Oriented Design:Method Parameter
Passing Arguments to Methods
public class Main { void toUpperCase(String[] text) { for (int i = 0; i < text.length; i++) { text[i] = text[i].toUpperCase(); }//from w w w. j av a2s .c o m } public static void main(String[] arguments) { Main passer = new Main(); passer.toUpperCase(arguments); for (int i = 0; i < arguments.length; i++) { System.out.print(arguments[i] + " "); } System.out.println(); } }