Message-ID: <1458458834.8085.1411504157545.JavaMail.email@example.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_8084_1333655339.1411504157545" ------=_Part_8084_1333655339.1411504157545 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Methods must be defined in
classes. They are declared just =
like functions are.
An object of
Cat must be instanced, then its methods can be=
Constructors and Destructors are special methods that are called on when=
class is being instanced or destroyed, respectively.
Both are optional.=20 =20
Whiskers Whiskers is no more... RIP=20
If a constructor has arguments, then they must be supplied when instanci= ng. Destructors cannot have arguments.=20 =20
All these modifiers also apply to properties (If they are explicitly dec=
static can also apply to fields.
This will cause the
Id to increase whenever an
is instanced, giving each
Animal their own, unique
All the methods defined in an
interface are automatically d=
Abstract methods in a
class must have a blank code block in its declaration.
Both declare roughly the same thing.=20
Member is fully accessible to all types.
Member is only visible to this class and inh= eriting classes.
Member is only visible to this class.= td>=20
One very nice feature that boo offers is being able to declare the value= s of properties while they are being instanced.=20 =20
The constructor didn't take any arguments, yet the
Value: 42 bit declared Value to be 42, all in a tighly compact, but highly readable=
Prey= code>. To the
Predatorclass, add an
Eatmethod t= hat eats the
Prey. Do not let the
Preybe eaten t= wice.
Go on to Part 10 - Polymorphism, or Inherited Methods<= /p>