I am in the process of learning java and have become quite stuck around arrays.
What I am trying to do is assign values to characters in an array. ie A = 0, B = 1, C = 2. Any help would be greatly be appreciated. Other questions similar to this haven't shown how to change A = 0 for exmaple.
public class Conversion{
public static void main (String [] args) {
String raw = "ABC";
int key = 3;
char[] list = raw.toCharArray();
int[] num = new int[raw.length()];
for (int i = 0; i < raw.length(); i++) {
num[i] = i + key;
}
System.out.print(num);
}
}
Thanks for the help,
Dave