Prev | Current Page 216 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

Private classes are
only available in their declaring file. The following class A is public while class B is private.
class A
{
//...
}
private class B
{
//...
}
A class name is a sequence of one or more alphanumeric characters, including the underscore character,
starting with an uppercase letter; this convention is enforced by the compiler that will throw a
compilation error otherwise. The class name is optionally followed by the keyword extends and by the
class name of a parent class. Finally the class declaration can include one or more implements
declarations. For each implements a single class name or interface name must be specified.
Features in classes are exposed as fields (also referred as members) of two kinds:
Variables: placeholders for value containers, references for objects, or function definitions. Variables
can be enhanced with access and value modifiers.
Functions: actions that the object or the class can perform.
??‘
??‘
103
Chapter 5: Delving Into Object-Oriented Programming
Variables and functions can be declared as static fields or as an instance.


Pages:
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228