Spring bean life cycle method

Sanjay Singh
2 min readFeb 29, 2020

--

BY USING WE CAN CLOSE Resource in STANDALONE APPS

Interview Question ?

close() method vs registershutdownhook()
Both method use for close the resource

case 1- close() method

After closing the resource we can’t call any method it will throw exception
it will NEVER throw exception

ANS is

--

--

Sanjay Singh
Sanjay Singh

Written by Sanjay Singh

Java, Spring Boot & Microservices developer Sharing knowledge, tutorials & coding tips on my Medium page. Follow me for insights & see story list section

No responses yet