for example I have following method in class BugReportFactory:
public static void addFactoryImpl(Class impl) { }
I want to call this method from another class by following ways:
BugReportFactory.addFactoryImpl(new BugReportFactoryAndroid());
It says that following Argument is not applicable for Class class.
Can anyone tell my mistake?
ONE MORE QUESTION:
private static IBugReportFactory INSTANCE = null;
public static void addFactoryImpl(Class impl) {
INSTANCE = (IBugReportFactory)impl;
}
But it shows errors specifying that you cannot cast class to object?