static void main(String Faggots) {
new Faggot(){
public void die() {
suicide();
}
};
}
there valid java, ``Faggot"
Name:
Anonymous2011-08-09 9:28
It doesn't translate to C++ because it uses Java's pseudo-closure feature of anonymous classes.
Also, sepplesox doesn't have real closures.
Name:
Anonymous2011-08-09 9:50
// This is your class motherfucker
class Faggot {
// under public: go all public methods and variables
public:
// the Faggot method
void die();
};
// Tell the compiler what the die() method does
void Faggot::die()
{
// although I have a feeling that this is some built in java bullshit and won't actually work
suicide();
}
int main() {
// creation of MyFaggot object
Faggot *MyFaggot = new Faggot();
// execute the die() method
MyFaggot->die();
// return 0 to tell the OS everything went OK
return 0;
}
Name:
Anonymous2011-08-09 9:57
>>5
Nope. The Java code made a (anonymous) subclass of faggot that commits suicide on death, whereas you made ALL faggots commit suicide on death.
Name:
Anonymous2011-08-09 10:02
// This is your class motherfucker
class Faggot {
// under public: go all public methods and variables
public:
// the Faggot method
void die();
};
// Tell the compiler what the die() method does
void Faggot::die()
{
// although I have a feeling that this is some built in java bullshit and won't actually work
suicide();
}
int main() {
// creation of MyFaggot object
Faggot *MyFaggot = new Faggot();
// execute the die() method
MyFaggot->die();
// return 0 to tell the OS everything went OK
return 0;
}
class Faggot {
public:
Faggot(void (*diefun)()) { die = diefun; }
void (*die)();
};
void die1()
{
suicide();
}
void main(void)
{
Faggot fag(die1);
fag.die();
}
this is as close as you get
Name:
Anonymous2011-08-09 11:38
class Faggot
{
public:
void (Faggot::*die)();
};
int main(int argc, char* argv[])
{
class DummyFaggot: public Faggot
{
public:
void die()
{
suicide();
}
};
Faggot* MyFaggot = new Faggot();
MyFaggot->die = (void (Faggot::*)())&DummyFaggot::die;
(MyFaggot->*(MyFaggot->die))();
return 0;
}
Name:
Anonymous2011-08-09 12:36
Sepples Eleven from Java direction translation version:
class Faggot
{
public:
virtual void die() = 0;
};
int main(int argc, char* argv[]) {
class DummyFaggot : public Faggot
{
public:
virtual void die() override {
suicide();
}
};
DummyFaggot f; // no need to use the heap, that's for bakas!
return 0;
}
Sepples Eleven non-faggot translation version (considering the original program is essentially a no-op):
int main(int argc, char* argv[]) {
return 0;
}
Forgot to mention to all of the other posters, but when does the die method on the faggot anonymous class actually get called? It doesn't. He's just creating object on the GC heap of that anonymous type, that's all. So why are you all calling die in your posts? Am I the only one who can program in both Java and C++ (including Sepples Eleven).
Name:
Anonymous2011-08-09 18:55
JESUS CHRIST YOU FUCKING RETARD, YOU CLOSE \`\`PROPER QUOTES\'\' WITH TWO APOSTROPHES.