Anytime you want to use type information at runtime, you must first get a reference to the appropriate Class object. Class.forName() is one convenient way to do this, because you don't need an object of that type in order to get the Class reference.However, if you already have an object of the t Read More
posted @ 2011-03-16 19:39 庚武 Views(496) Comments(1) Diggs(0) Edit
package dynamicproxy;public interface SimpleInterface { void doSth(); void doSthElse(String s);}package dynamicproxy;public class RealObject implements SimpleInterface { @Override public void doSth() { System.out.println("Real Object do sth"); } @Override public void doSthElse(String s) { Read More
posted @ 2011-03-16 19:17 庚武 Views(341) Comments(1) Diggs(0) Edit