function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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.