Message-ID: <1638395658.1065.1432438558078.JavaMail.email@example.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_1064_1874274322.1432438558077" ------=_Part_1064_1874274322.1432438558077 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>