public class ListEx {
    public static void mymethod()
        list<integer> myList= new List<integer>();

        integer lsize= myList.Size();
            system.debug('List Size'+lsize);



Declaring Method in APEX:


Whenever i try to run a program It is throwing an error saying

"Method does not exist or incorrect signature: void mymethod() from the type ListEx "`

enter image description here enter image description here

  • 1
    this script runs properly Commented Aug 9, 2017 at 19:23
  • Can you edit this question to include a test class others can use to help you debug this issue? Commented Aug 9, 2017 at 19:39
  • Is your ListEx class actually saved? I only ask because the * is still showing in the Developer console, which implies it hasn't been saved yet. Commented Aug 9, 2017 at 22:40
  • @jamesandy Is your issue now resolved? Commented Aug 10, 2017 at 0:00

1 Answer 1


From the comment thread is seems like the issue was related to the Apex class not yet being saved in the Developer Console.

The * that is appearing in the file name in the dev console indicates that the file hasn't been saved since it was last modified. In your case it appears that it has never been saved.

You will need to save the Apex class before it become accessible to anonymous apex.

You must log in to answer this question.

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