we can call non static method from static method
class xyz{
public void Multi(){ Console.WriteLine("Non Static Method");}
public void Multi(){
Console.WriteLine("Non Static Method");
}
}static class abc{
static void Add(){ xyz c=new xyz(); c.Multi(); //calling non static method from static method Console.WriteLine("Static Method");}static void Main() {
static void Add(){
xyz c=new xyz();
c.Multi(); //calling non static method from static method
Console.WriteLine("Static Method");
static void Main()
{
xyz a=new xyz(); a.Multi(); }}
private static void OnReadComplete(IAsyncResult result) {ClassName objClassName = new ClassName();objClassName.methodName(); }
We can call non-static method from static method by creating instance of class belongs to method, eg) main() method is also static method and we can call non-static method from main() method .
Even private methods can be called from static methods with class instance.
yes. But we need to create object to call the method inside static method.
non static method must be a public method. non static method must be a public class. create a instance for that class and then we can access the method.