Advertisement
Latinist

Untitled

Apr 9th, 2020
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.36 KB | None | 0 0
  1. @SpringBootApplication
  2. public class DemoApplication {
  3.  
  4.     @Bean
  5.     public static HelloWorld getMessageBean(){
  6.         HelloWorld hw = new HelloWorld();
  7.         hw.setMessage("Hello World!");
  8.         return hw;
  9.     }
  10.  
  11.     public static void main(String[] args) {
  12.         SpringApplication.run(DemoApplication.class, args);
  13.         System.out.println("Message: " + getMessageBean().getMessage());
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement