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
Jyosi jyosiJyosi jyosi 

Error: Compile Error: expecting a right parentheses, found 'abc' at line 3 column 13)

Hello Everyone,
public class abc{
system.debug('abc');

/[Error] Error: Compile Error: expecting a right parentheses, found 'abc' at line 3 column 13

I am not sure why i am getting this error .

can you please help me out.

}
Terence_ChiuTerence_Chiu
You need to place the call to debug into a method.

public class abc{

     public void someMethod(){
              system.debug('abc');
     }
}
 
DmonikaDmonika
Hi Jyosi.
System.debug() cannot be executed direcly inside the class. It should be inside the method of a class.

delcare a method for that class and impelement  your system.debug .

Hope it surely helps you 

Thanks
Monika
Amit Chaudhary 8Amit Chaudhary 8
Hi Jyosi,

System.debug() cannot be executed direcly inside the class. It should be inside the method of a class or constructor


public class abc{

     publicabc(){
              system.debug('abc');
     }
}
I hope this will help you