@TheLittleNaruto just I have a small question, why did you use void as __construct() ? void function will be executed when you make an object of the class in Java?
@TheLittleNaruto just for your information, it seems myclass is a reserved word in Java .. by renaming it to myclass1, the code you provided works as well in Eclipse IDE.