I read the LogFactory.class source code in JDK.
LogFactory.class declares an abstract class LogFactory. There is a static attribute in the source code, and the code related to this attribute is as follows:
public abstract class LogFactory{
//
//...
static LogFactory logFactory = new SLF4JLogFactory();
//
//...
}
where the class SLF4JLofFactory is a subclass of the abstract class LogFactory. The above code overrides abstract methods in the abstract class LogFactory by transforming upwards.
my question is, what is the purpose of declaring an attribute of a static LogFactory class in the abstract class LogFactory? What is the purpose or idea of instantiating this class in an abstract class?