+ Start a Discussion
SS KarthickSS Karthick 

Expecting equal sign found

Hi folks,
      how to fix the following error:

Expecting equal sign found


List<Topic> to=[select id,name from topic ];

for(Integer i;i<to.size();i++)
    System.debug('topic:'+to[i]);

Thanks in advance
Karthick
Best Answer chosen by SS Karthick
Vatsal KothariVatsal Kothari
Hi,
Refer below code:
List<Topic> to=[select id,name from topic ];

for(Integer i=0; i<to.size(); i++)
    System.debug('topic:'+to[i]);


All Answers

Vatsal KothariVatsal Kothari
Hi,
Refer below code:
List<Topic> to=[select id,name from topic ];

for(Integer i=0; i<to.size(); i++)
    System.debug('topic:'+to[i]);


This was selected as the best answer
Asif Ali MAsif Ali M
Karthick,

You need to initialise the i variable in for statement as shown in above code snippet.