Wednesday, July 4, 2018

Accessor Methods

Accessor methods enable other elements to set or get the values of variables in a
class and it is common that they do both.
The following example accepts a value as a parameter, sets a class variable to
this value and then returns the value. The parameter has a default value set to the
class variable value, so if the method is called without a parameter, it returns the
value of the class variable. If it is called with a value in the parameter, then the
class variable is set to this value.


1
2
3
4
5
public str myName(str _myName = myName)
{
   myName = _myName;
   return myName;
}

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...