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
Sales Force FRMSales Force FRM 

Compilation errors in apex code (Developer edition)

Hi Folks,
                  i am trying to run apex script  (setup-->Develop-->APex Classes)  in sales force developer ,which is as follows:

1 public class sObjectTest

2 {

3 // Create a generic sObject variable

4 sSObject s = Database.query('select id from account limit 1');

5 // Verify if that sObject variable is an Account token

6 System.assertEquals(s.getSObjectType(), Account.sObjectType);

7 // Create a list of generic sObjects

8 List<sObject> l = new Account[]{};

9  // Verify if the list of sObjects contains Account tokens

10 System.assertEquals(l.getSObjectType(), Account.sObjectType);

11 }

when try to to save the code it's giving following errors:

Error: Compile Error: unexpected token: at line 6 column 37

how can i overcome this compilation error.

and how to run this code if compiled successful.
Ron HessRon Hess
this feature

sObjectType


is not released until Summer 08
sunny.dale5sunny.dale5

I think the best set up to minimize errors is to debugging and make many trials and adapt different set up everytime.