C
C#5mo ago
Cgrevox

how to call another method

ok, so, I'll post a screen to explain better: how can i call a method that is on another file? or maybe i'm wrong and the question is hot to call a file. if anyone knows the solution please tell me. i want to make things better by making other files.
No description
3 Replies
Pobiega
Pobiega5mo ago
there are two ways, depends on if the other method is static or not static: ClassName.MethodName(); non-static: create an instance of the class var x = new ClassName(); call method: x.MethodName();
Cgrevox
CgrevoxOP5mo ago
thank you so much!
Cattywampus
Cattywampus5mo ago
myClass.MyMethod() is called instance method

Did you find this page helpful?