Your text editor made the wrong apostrophes, resulting in code that failed to compile. // This will not compile System.debug(‘I am static method’); // This one is okay System.debug('I am static method'); Make sure you're not using Microsoft Word or some other "smart" editor to write your code. If copy-pasting, make sure the apostrophes are not "smart quotes."