Cum stă treaba cu Treimea
Dumnezeu e unul singur, format din 3 persoane. Greu de conceput, nu? Nu şi când e vorba de OOP!
interface HolySpirit {
public function sayName();
}class Father implements HolySpirit {
public function sayName() {
echo ‘In the name of the Father and the Holy Spirit’;
}
}class Son implements HolySpirit {
public function sayName() {
echo ‘In the name of the Father, Son and the Holy Spirit’;
}
}$God = new Son();
$God->sayName();


Bun. Şi totuşi cine a făcut UNIX-ul?
Singularitatea gravitaţională…
interface HolySpirit {
public function sayName();
public function getInstance();
}
Dumnezeu e numai unul => singleton
de la exemplele cu caini si purici pe care le dadeai la java ai trecut la Father…asta da transformare
:)
Totuşi cred că trebuia scris ceva de genul class Son extends Father{ boolean hangOnCross;
boolean walkOnWater;
int children=0;
void haveChildrenWithMagdalena() { children++;}
}
Huper> dap! Ma’ bad
tudor, vezi ce au patit TLP, dazeloop si dumnezeueateu?
tu nu simti un fior dumnezeiesc in aceasta zi (hint) sfanta?