Reference a static member function without using the class name : Object Reference : Class C# Examples


C# Examples » Class » Object Reference »

 

Reference a static member function without using the class name









    
public  class  A
{
      public  static  void  SomeFunction()
      {
            System.Console.WriteLine(  "SomeFunction()  called"  );
      }

      static  void  Main()
      {
            A.SomeFunction();
            SomeFunction();
      }
}
    
   
  
   



Output

SomeFunction() called
SomeFunction() called


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Class
» Object Reference