static void Main(string[] args) { ArrayList array = DataFileReader.DataFile(args[0]); String characters = args[0]; ArrayList wordLength = WordLength(characters,array); // this will pass the variables to your method }