for example, I have the following method in the BugReportFactory class:
public static void addFactoryImpl(Class impl) { }
I want to call this method from another class in the following ways:
BugReportFactory.addFactoryImpl(new BugReportFactoryAndroid());
It states that the following argument is not applicable to the Class class.
Can someone tell me my mistake?
ONE MORE QUESTION:
private static IBugReportFactory INSTANCE = null;
public static void addFactoryImpl(Class impl) {
INSTANCE = (IBugReportFactory)impl;
}
But does it show errors indicating that you cannot expose a class to an object?
source
share