I have a print statement in a loop that should be iterating like this: "A0" "B1" "C2" "B3", "C4". It is instead returning 6567697173.
Here's the code:
MAIN METHOD
public class AdvDotComLauncher {
public static void main(String[] args) {
AdvDotComTable table = new AdvDotComTable();
table.createTable(5,5);
}
}
TABLE CLASS
import java.util.ArrayList;
public class AdvDotComTable {
public boolean createTable(int rows, int columns) {
if (rows == 26) {
//When true is returned, the program will let the user know they have to choose a lower number
return true;
}
String[] dotComs = {"Pets.com", "Amazon.com", "Target.com", "Apple.com", "Microsoft.com", "Steampowered.com"};
ArrayList<Character> row = new ArrayList<Character>();
ArrayList<Integer> column = new ArrayList<Integer>();
char[] letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
int number = 0;
while (rows != 0 && columns != 0) {
row.add(letters[number]);
column.add(number);
System.out.print(row.get(number) + column.get(number));
number++;
rows--;
columns--;
}
return false;
}
}
I have no idea what is causing this problem, and any assistance would be appreciated. I am an amateur developer just trying to learn, so it's probably a silly mistake (sorry about that).
Thanks in advance,
Lyfe