You need to sign in to do that
Don't have an account?
shrayas reddy
I am getting a EOF error at 6th line in the code. I don't know how to resolve it
public class Myclass {
void writeLog(){
System.debug('hello world');
}
}
Myclass c = new Myclass();
c.writeLog();
void writeLog(){
System.debug('hello world');
}
}
Myclass c = new Myclass();
c.writeLog();
You need to add access modifiers before void for the method to be visible, it can be private/global/public/protected.
To check more regarding access modifiers you can check this link:https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_access_modifiers.htm
Please try the below code:
Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.