Hey. From what i remember there are two ways of implementing if-statements. 1: The classic way with if(this is true){do this}, and 2: the less used way to implement it at one line using a question mark. Im trying to understand a bit of code where number 2 is used inside a number 1 (messy code..?), but i cant get it. As you probably understand, recordNum is an int, cb.getValue returns true/false and the .split is splitting a String into a String[] where there are tab's appearing. Can anyone easily explain whats happening here, of maybe rewrite it with only number 1 if-statements? Thanks :)
for(int i = 0;i < recordNum;i++) {
if(dataLine[(cb.getValue())?(i+1):i].split(" ").length<=1) {
}
else {
String[] temp = dataLine[(cb.getValue())?(i+1):i].split(" ");