[fpc-pascal] Java equivalent of Pascal's class reference functionality
rymg19 at gmail.com
Thu Jun 9 01:23:15 CEST 2016
Not sure about your question exactly, but everything in Java is passed by
reference, and all objects are covariant, so you shouldn't need to do
On Wed, Jun 8, 2016 at 6:17 PM, Graeme Geldenhuys <
mailinglists at geldenhuys.co.uk> wrote:
> I know this is not a Java forum, but thought maybe somebody here with
> Object Pascal and Java knowledge could help (seeing that Java-only
> developers might not know what I'm talking about).
> Does Java have an equivalent feature of a Object Pascal language's Class
> For Example:
> I want to write Java code that does similar to my Object Pascal code
> shown below:
> TVisClassRef = class of TVisitor ;
> procedure ExecuteVisitor(const pData: TVisited; const pVisClass:
> lVisitor: TVisitor;
> lVisitor := pVisClass.Create; // <<-- Important Part
> This procedure takes care of the tedious business of creating the
> visitor, calling iterate, then freeing the visitor when done. I can pass
> in various class references as the second argument (all descendants of
> TVisitor), and different class instances will be created and used as
> I would love to know how I could do this in Java.
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
[ERROR]: Your autotools build scripts are 200 lines longer than your
program. Something’s wrong.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal