Pergunta de entrevista da empresa Transit Technologies

How would you ensure 2 different environments are initialized at startup using Spring Boot Optimize a method involving Spring boot. What are final, finally, and finalize? How would you write code that utilizes finally