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
K RoyK Roy 

creating an account from apex

Hello I am learning apex and i am very new with it. I was working on a trigger, and i have got this piece of code. However, i am getting an error. 
Please find the code below.

Contact test1 = new Contact(Last Name='Allergan Verma');
insert test1;

The error is "Unexpected token: test1". Can anyone guide me through this?
Best Answer chosen by K Roy
SandhyaSandhya (Salesforce Developers) 

Try below code.

Contact test1 = new Contact(LastName='Allergan Verma');
insert test1;

Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
Best Regards