Identify the correct way to call a non-static method inside main().

Last Updated :
Discuss
Comments

Identify the correct way to call a non-static method inside main().

methodName();

this.methodName();


new ClassName().methodName();

ClassName.methodName();


Share your thoughts in the comments