Array declared and initialized in one line.
This commit is contained in:
parent
c2d37e99e1
commit
1d94492e29
|
@ -8,15 +8,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||
public class ThymeleafArrayController {
|
||||
@GetMapping("/arrays")
|
||||
public String arrayController(Model model) {
|
||||
String[] continents = new String[7];
|
||||
|
||||
continents[0] = "Africa";
|
||||
continents[1] = "Antarctica";
|
||||
continents[2] = "Assia";
|
||||
continents[3] = "Australia";
|
||||
continents[4] = "Europe";
|
||||
continents[5] = "North America";
|
||||
continents[6] = "Sourth America";
|
||||
String[] continents = {"Africa", "Antarctica", "Asia", "Australia", "Europe", "North America", "Sourth America"};
|
||||
|
||||
model.addAttribute("continents", continents);
|
||||
|
||||
|
|
Loading…
Reference in New Issue