Spring, Spring Boot, Spring Framework, Java, Programming.
Thread.sleep(3000); } catch (InterruptedException e) { // Handle interrupted exception e.printStackTrace(); } } } By adding the @Async annotation, Spring will execute these methods in separate threads, allowing them to run concurrently without waiting for each other to finish. This way, task1()