Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
Hello Kishori, Thanks for your reply. > You have a method and which takes a parameter of a class, say Shape. No, that is not my query. I want to write a method that takes a reference to a Class definition rather than an Object instance. The object has not yet been instantiated. So my method signature might look like: void aMethod(ClassOfShape classReference) { Note that the instance of Shape does not exist before I call aMethod(). I have solved this problem by having an abstract factory: void aMethodTwo(ShapeFactory factory) { But that seems a bit clumsy compared to the Delphi way I am used to. I was just wondering if there is a Java equivalent to the Delphi approach.
Replies:
|
Sponsored Links
|