I have three textboxes ct1,ct2,ct3. I have to use a for loop 1 to 3 and check whether the textboxes are empty. So, inside the for loop, how do I represent it? For example,
for(i=0;i<=3;i++)
{
if(ct+i.getText()) // I know I'm wrong
{
}
}
There’s your problem to start with. Instead of using three separate variables, create an array or collection:
Or:
Then in your loop:
Or if you don’t need the index: