When and why should a static method be used?

Asked

Viewed 81 times

0

I always had this question about the POO, I see many codes with Static methods and now starting in C# is no different. Being direct, when you should use this type of method, why use it and its main function! Thank you!

  • When you want to use the method without having to instantiate an object.

  • Got it, thank you very much Jbueno! D

  • I will not create an answer and give details pq I’m on the phone. Other than that, I think you already have this on the site, but I could not find anything. Anyway, if you have any answer will be linked here, otherwise someone will write a reply.

  • I could understand from your answer, I was with Visual Studio open and wrote some lines of code testing your answer and I could understand. I appreciate the help.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.