• KEYUR SHAH 94
  • NEWBIE
  • -1 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I have created HelloWorld example class in developer console which is in apex work book


public class HelloWorld{
    public static void sayYou(){
        System.debug('you');
    }
     
    public void sayMe(){
    System.debug('Me');
    }
}


I think I have created top - level class and declared static method and instance method in that class.

But when I execute this class I am getting error saying that 'Only top-level class methods can be declared static'

Please help me if there is any wrong in my example. 
 
I am new to apex code.I think it is silly doubt but please help me.