Hi every one, new poster here and new to Java as well.
I'm working on a java program that will reads an excel file extracts the data and prints it to console. I've gotten that part to work in the below code, however I'm starting the next phase of the program where the data extracted needs to be compared to certain values, if the comparison returns true then it prints the data.
This is where I'm stuck. I can't figure out what data type my listCollector 2d array is getting from the hssfCell.toString() command. i thought it was getting string values, but when comparing it to string[] checker, every thing equates to false, even though I know the 1 value in checker will/is inside the listCollector.
private void printToConsole(List cellDataList){
int row = 0;
int col = 0;
String[] checker = {"PONUMBER"};
for (int x = 0; x < cellDataList.size(); x++){
List cellTempList = (List) cellDataList.get(x);
row = cellDataList.size();
col = cellTempList.size();
String[][] listCollector = new String[row][col];
for (int y = 0; y < cellTempList.size(); y++){
HSSFCell hssfCell = (HSSFCell) cellTempList.get(y);
listCollector[x][y] = hssfCell.toString();
if(listCollector[0][y] == checker[0]){
System.out.print(listCollector[x][y] + "\t");
}
}
}
}