Method does not exist or incorrect signature: void printOutput(String) from the type Demo

I am very new to the Salesforce, I am running my first program and it shows an error Method does not exist or incorrect signature, seems my code is OK

public class Demo
    public void printOutput(String s1)     
        System.debug('Display String ' +s1);


Demo1 d1 = new Demo1();
d1.printOutput('Hello World');

1 answer

  • answered 2022-01-23 11:38 Akshay Patil

    You creating wrong instance of class Demo. try this:

    Demo d1 = new Demo();
    d1.printOutput('Hello World');

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum