how to call a method that is in another file in c#?
how to call a method that is in another file in c#?
3 Replies
In Program.cs file:
In Luz.cs file:
What file something is in is not really relevant. Everything in C# is part of some class and if you need to access something you do it via either a class instance or, if it's static, via the type.
In your example:
Since Luz1 is static you access it via the type it is defined in, in this case Program.
Thank you very much, it worked