Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes Dynamic class loading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Dynamic class loading " Watch "Dynamic class loading " New topic
Author

Dynamic class loading

Richard Green
Ranch Hand

Joined: Aug 25, 2005
Posts: 536
Ok. here is my problem




Please note the commented code snippet. I would like to dynamically load a class and pass it as an argument to the displayDocument() method.

However


is not valid, as they are incompatible conditional operand types. How do I get around this?

P.S: Interestingly, c.getInterfaces() returns an empty array (I expected it to return DocumentProviderIntf).

[ June 28, 2006: Message edited by: Lynette Dawson ]
[ June 28, 2006: Message edited by: Lynette Dawson ]

MCSD, SCJP, SCWCD, SCBCD, SCJD (in progress - URLybird 1.2.1)
Lionel Port
Greenhorn

Joined: Sep 14, 2002
Posts: 19
You only have the Class. You need to create an instance of the class.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic class loading
 
Similar Threads
how to avoid synchronization problem in webpage
JTextField - display dd/mm/yyyy
Delay while I type characters in the text box
JSP + JSTL + SQL
A decent text editor for windows