what is the difference between AbstractApplicationContext and ApplicationContext ?
can we call
context.registerShutdownHook()
using ApplicationContext?
I saw this while going through a sample code –
public static void main(String[] args) {
AbstractApplicationContext context =new ClassPathXmlApplicationContext("Beans.xml");
context.registerShutdownHook();
}
Same as the diff between abstract class (AbstractApplicationContext ) and an interface (ApplicationContext).
Can we call context.registerShutdownHook() using ApplicationContext?
No, because
registerShutdownHook()is part ofConfigurableApplicationContextinterface which is not extended byApplicationContext