You need to sign in to do that
Don't have an account?
Ashutosh Mohan
Method does not exist or incorrect signature: void add() from the type addition
public class addition {
integer a,b,c;
public void add(){
a=2;b=4;
c=a+b;
system.debug('the add is :' +c);
}
}
addition c = new addition();
c.add();
integer a,b,c;
public void add(){
a=2;b=4;
c=a+b;
system.debug('the add is :' +c);
}
}
addition c = new addition();
c.add();
Please write below code in Anonymous window than you can able to execute your logic. (Shortcut is CTRL + E)
Please choose it best answer if your doubt is clear.
Thanks,
Satish prajapat
thank you for you reply ,i m writing the same code in Anonymous window but still i am getting the same error while executing
addition c = new addition();
c.add();
Your code is working in my org.
Please check the image below:
Thanks.