How can we define array in katalon to save values in for loop

You want array rather than List. OK. It is just possible.

I rewrote the Example.1 of https://www.katalon.com/resources-center/tutorials/handle-web-tables/ .

At first, just a rewrite the Example1. I did rewriting because the coding style of the original code in the URL looks a bit odd to me.

import org.openqa.selenium.By as By
import org.openqa.selenium.WebDriver as WebDriver
import org.openqa.selenium.WebElement as WebElement
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
/**
 * reproducing the Example.1 in
 * https://www.katalon.com/resources-center/tutorials/handle-web-tables/
 *
 */
WebUI.openBrowser('')
WebUI.setViewPortSize(703, 347)
WebUI.navigateToUrl('http://demoaut-mimic.kazurayam.com/18107_testbed.html')
WebDriver driver = DriverFactory.getWebDriver()
// To locate table
WebElement table = driver.findElement(By.xpath('//table/tbody'))
// To locate rows of table it will capture all the rows available in the table
List<WebElement> rowsInTable = table.findElements(By.tagName('tr'))
// To calculate number of rows in the table
int rowsCount = rowsInTable.size()
WebUI.comment("rowsCount=${rowsCount}")
// Iterate over all the rows of the table
for (int r = 0; r < rowsCount; r++) {
    // To locate columns(cells) of that specific row
    List<WebElement> columnsInRow = rowsInTable.get(r).findElements(By.tagName('td'))
    // To calculate number of columns in that specific row
    int columnsCount = columnsInRow.size()
    WebUI.comment("Number of cells in row ${r} are ${columnsCount}")
    // Iterate over the cells of that specifc row
    for (int c = 0; c < columnsCount; c++) {
        // Retrieve text from each cell
        String cellText = columnsInRow.get(c).getText()
        WebUI.comment("Cell value of (${r},${c}) is '${cellText}'")
    } 
}
WebUI.closeBrowser()

Then a rewrite with arrays.

import org.openqa.selenium.By as By
import org.openqa.selenium.WebDriver as WebDriver
import org.openqa.selenium.WebElement as WebElement
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
/**
 * reproducing the Example.1 in
 * https://www.katalon.com/resources-center/tutorials/handle-web-tables/
 *
 * using arrays rather than List
 */
WebUI.openBrowser('')
WebUI.setViewPortSize(703, 347)
WebUI.navigateToUrl('http://demoaut-mimic.kazurayam.com/18107_testbed.html')
WebDriver driver = DriverFactory.getWebDriver()
// To locate table
WebElement table = driver.findElement(By.xpath('//table/tbody'))
// To locate rows of table it will capture all the rows available in the table
WebElement[] rowsInTable = table.findElements(By.tagName('tr')) as WebElement[]
// To calculate number of rows in the table
int rowsCount = rowsInTable.length
WebUI.comment("rowsCount=${rowsCount}")
// Iterate over all the rows of the table
for (int r = 0; r < rowsCount; r++) {
    // To locate columns(cells) of that specific row
    WebElement[] columnsInRow = rowsInTable[r].findElements(By.tagName('td')) as WebElement[]
        // To calculate number of columns in that specific row
    int columnsCount = columnsInRow.length
    WebUI.comment("Number of cells in row ${r} are ${columnsCount}")
    // Iterate over the cells of that specifc row
    for (int c = 0; c < columnsCount; c++) {
        // Retrieve text from each cell
        String cellText = columnsInRow[c].getText()
        WebUI.comment("Cell value of (${r},${c}) is '${cellText}'")
    } 
}
WebUI.closeBrowser()

Difference of List and array comes up only when you want to add/delete an entry. With List, adding an entry is a breeze. With array, adding an entry is a cumbersome task. In the above code we are not adding entries so that you would find very little difference between the two. Almost all of Java/Groovy APIs prefer List to array, so that you need to learn the List anyway.