<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-06-09 1:17 GMT+02:00 Graeme Geldenhuys <span dir="ltr"><<a href="mailto:mailinglists@geldenhuys.co.uk" target="_blank">mailinglists@geldenhuys.co.uk</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Does Java have an equivalent feature of a Object Pascal language's Class<br>
Reference.<br clear="all"></blockquote><div><br></div><div>+/- yes, it is called Class and you need no-arg constructor for that:<br><br><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html">https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html</a><br><br>public void executeVisitor(TVisited pData, Class<TVisitor> pVisClass)<br>
{<br> TVisitor lVisitor = null;<br> try {<br> lVisitor := pVisClass.newInstance(); // <<-- Important Part<br> } catch (InstantiationException e) {<br> LOG.error("HINT: probably missing no-arg constructor for Entry: " + pVisClass.getName());<br> throw e;<br> }<br>
<br>
...<br>
}<br></div></div><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Best regards,<br>Maciej Izak</div></div></div>
</div></div>