I'm new to C #, so I'm struggling with basic concepts.
I created several classes in one project under one namespace, in which one class has Main () and other classes do not. Now I want to use other classes inside the same class.
I don’t understand how I can import all classes inside one class and call their functions, creating objects inside the Main () class.
As in Java, we used import packagename.ClassName;
In C # how to do the same?
Suppose I have one project named UseOfMultipleClasses. It has one class file called Program.cs, which has Main (). Now I have created 2 more classes. Add.cs has the addnum () function, and subtract.cs has subnum (). I want to name these two functions inside the Main () of the Program class. How to do it?
source
share