2016-06-09 1:17 GMT+02:00 Graeme Geldenhuys <mailingli...@geldenhuys.co.uk>:
> Does Java have an equivalent feature of a Object Pascal language's Class > Reference. > +/- yes, it is called Class and you need no-arg constructor for that: https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html public void executeVisitor(TVisited pData, Class<TVisitor> pVisClass) { TVisitor lVisitor = null; try { lVisitor := pVisClass.newInstance(); // <<-- Important Part } catch (InstantiationException e) { LOG.error("HINT: probably missing no-arg constructor for Entry: " + pVisClass.getName()); throw e; } ... } -- Best regards, Maciej Izak
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal