AbstractApplicationContext vs ApplicationContext

后端 未结 3 1625
悲哀的现实
悲哀的现实 2021-02-19 15:06

what is the difference between AbstractApplicationContext and ApplicationContext ? can we call

context.registerShutdownHook()  
         


        
3条回答
  •  孤城傲影
    2021-02-19 16:08

    Same as the diff between abstract class (AbstractApplicationContext ) and an interface (ApplicationContext).

    Can we call context.registerShutdownHook() using ApplicationContext?

    No, because registerShutdownHook() is part of ConfigurableApplicationContext interface which is not extended by ApplicationContext

提交回复
热议问题