web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

Class modifiers

DaxNigel Profile Picture DaxNigel 2,574

We can apply several modifiers to the declaration of classes, methods, and variables.

abstract (classes and methods): The abstract modifier forces us to override the method in a subclass, since the parent class is not implemented.

display (method): The display modifier allows the method to return a value for use on a page. We cannot change the value displayed.

edit (methods): The edit modifier allows the method to return field information for use on a page. The user can change the value.

final (classes and methods): The final modifier means we cannot override the object in any derived class.

public (methods and variables): The public modifier means we can access anywhere the objects that the class is accessible. Objects that have no modifier are implicitly public.

protected  (methods and variables): The protected modifier means the objects would only be accessible from the class or a derived class (sub class).

private (methods and variables): The private modifier means we can only access the object from the class instance. Sub classes could not access the objects with a private modifier.

static (methods and variables): The static modifier means the object is not part of the class instance. They are called using the class name. Example of a method MyClass::StaticMethod(). We should avoid using static with variables.


This was originally posted here.

Comments

*This post is locked for comments