How does Spring Boot load changes in code without restarting the server

You only need to add devtool dependency in pom.xml and yml file property:

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <optional>true</optional>
    </dependency>

# for not restarting the server every time
spring.devtools.restart.enabled:  false

Add spring-boot-devtools module to your project, which includes LiveReload server which can be used to trigger a browser refresh whenever a resource has been changed.You can download browser extensions from livereload.com.

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
    </dependency>
</dependencies>