HI i have a method that is supose to store the alphabet in an array however dont think that it is being added to the array.
The first print will display the letter but after attempting to add it to the array the second print wont work?
Code:
public static void GetAlphabet (char alphabet[]) { int index, ordinalVal = 97; char element; for (index = 1; index < alphabet.length; ++index, ++ordinalVal) { element = (char) ordinalVal; System.out.println("Letter: " + element); alphabet[index] = element; System.out.println("Letter: " + alphabet[index]); }
Comment