package com.spartancoder;

import org.springframework.stereotype.*;
import org.springframework.web.bind.annotation.*;

@Controller
public class SpartanController {
    @RequestMapping("/hello")
    @ResponseBody
    String home() {
        return "Hello World!";
    }
}
package com.spartancoder;

import org.springframework.stereotype.*;
import org.springframework.web.bind.annotation.*;

@Controller
public class SpartanController {
    @RequestMapping("/hello")
    @ResponseBody
    public String home() {
        return "Hello World!";
    }
}
Refactor on main class