i have been trying to write a method that generates random letters between two given char values. So far i believe the best way is to convert the char characters to ascii values then compare them with the user input and make a for loop between those 2 values. My problem is i dont know how to compare the values after they have been converted here is my code so far:
public void add (char fromChar, char toChar){
Random a = new Random();
char[] characters = { 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
int start =65;
for(int i =0; i<characters.length;> characters[i] = start;
start++;
}
for(int i = fromChar; i<tochar;> System.out.println(a.nextInt(fromChar,toChar);
}
}
[edit]Spurious bold removed, Code block added - OriginalGriff[/edit]