Tuesday, July 3, 2018

Static Methods

Static methods are attached to a class. However, they do not need that class to be
instantiated to execute that method. They are not within the scope of the class, so
any class variables are not available in a static method.
Static methods are declared static by using the Static method modifier.
Static methods are called using the class name followed by two colons (::) and
then the methods name.
The following example shows a static method declaration, and a call to that static
method.


1
2
3
4
 static public void myStaticMethod()  
{  
}  
  myClass::myStaticMethod() 

Best Regards,
Hossein Karimi

No comments:

Post a Comment

Configure the Firewall on the Enterprise Portal Server

After you install Enterprise Portal, enable Web Server (HTTP) in Windows Firewall. If you do not enable the web server in Windows Firewall...