On 01/27/2017 08:48 AM, Jonas Maebe wrote:
On 27/01/17 02:31, Jon Foster wrote:
But any classes defined in Pascal provide those methods, if they descend
from the default TObject. I think I read somewhere that classes can be
defined that descend from the base Java class but I haven't done it.

All classes on the JVM descend from a Java class. The Java Runtime does not support classes that don't descend directly or indirectly from java.lang.Object.
Yes, BUT: TObject is provided by the "system" unit in FPC and although it descends from JLObject it provides basic FPC like semantics, including free/destroy. FPC treats " TMyClass = class ..." just like it does in the native code versions and TMyClass would descend from TObject inheriting its methods. So unless you tried to create a class which directly descended from JLObject, instead of TObject you inherit "free" and "destroy", so you can call them as you usually would.

Other than missing unit functionality I've found the JVM implementation makes Java seem very Pascal like. The devs have done a splendid job IMO. It did take me a while to find the Java lib equivalent of StrToInt. :-D

-Jon

--
Jon Foster
JF Possibilities, Inc.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to