基于springboot写一个helloworld
时间: 2023-05-11 19:07:09 浏览: 101
springboot-helloworld
Sure, here is a simple example of a Spring Boot application that prints "Hello, World!" to the console:
```java
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class HelloWorldApplication {
public static void main(String[] args) {
SpringApplication.run(HelloWorldApplication.class, args);
System.out.println("Hello, World!");
}
}
```
This application uses Spring Boot's auto-configuration to set up a basic web application context, and then prints the "Hello, World!" message to the console.
阅读全文