0

When I save this class I get the following error:

Compile Error: unexpected token: 'global Class apexclassfirsttimeinmerket implements Database.Batchable' at line 1 column 0

Code:

global Class apexclassfirsttimeinmerket implements Database.Batchable<sObject>{


    global Database.QueryLocator start(Database.BatchableContext BC)
    
    {    
        String queryhye= 'SELECT ID,NAME,description FROM Account';
        
        return database.getQueryLocator(queryhye);
        
    }
    
   
    global void execute(Database.BatchableContext BC, List<Account> scope)
    
        {
        
        System.debug('all reocrds area is null');
        
            for(account a : scope)
            
            {
                System.debug('for loop has started bhai logo');
                
                if(a.description == NULL)
                {
                    a.description='pimple saudagar';
                    
                 }
            }
            
        update scope;
        
        
      }
      
      
   global void finish( Database.BatchableContext BC)
   {
   
       System.debug('all the records area have updated now');
       
     }
     
  } 
1
  • No idea, works fine for me
    – kurunve
    Feb 27, 2017 at 17:03

1 Answer 1

4

According to https://www.textmagic.com/free-tools/unicode-detector, your code contains non-breaking spaces that confuse the Apex compiler. (Cutting and pasting code can sometimes pickup unexpected characters.) Re-key the spaces (or run the code through an editor) to remove them and the code should compile.

1
  • Those pesky ZWS characters are always hiding!
    – sfdcfox
    Feb 27, 2017 at 17:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .