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
Garen BarnettGaren Barnett 

expecting a right parentheses, found 'Test Pre-Cert'

public class CoverSheet {

    
    Public List<String> AttTo = new List <String>();
    AttTo.add('Test Pre-Cert');
    AttTo.add('Jim Waller Pre-Cert');
    AttTo.add('Eileen Fitzpatrick');
        
    public String[] To = New String[3];
    To.add('Pre-Cert Company');
    To.add('Regence Behaviorial Health');
    To.add('Blue Cross Federal');
    
}

What in the world am I doing wrong,   I have tried everything

Line 5: expecting a right parentheses, found 'Test Pre-Cert'
Dilip_VDilip_V
Hi Garen,

You havn't defined a method.

You can add elements only in the method definition or constructor.
 
public class CoverSheet 
{
    Public List<String> AttTo = new List <String>();
    public String[] To = New String[3];
Public void TestListString(){
    AttTo.add('Test Pre-Cert');
    AttTo.add('Jim Waller Pre-Cert');
    AttTo.add('Eileen Fitzpatrick');
        
    To.add('Pre-Cert Company');
    To.add('Regence Behaviorial Health');
    To.add('Blue Cross Federal');
    }
}
Let us know if it helps.

Mark it as best answer if it work.
Thanks.