From the course: Spring Boot 3 Essential Training
Unlock this course with a free trial
Join today to access over 24,600 courses taught by industry experts.
Challenge: Build a CommandLineRunner - Spring Boot Tutorial
From the course: Spring Boot 3 Essential Training
Challenge: Build a CommandLineRunner
(upbeat music) - [Instructor] So now it's time for our first challenge exercise of the course and that's going to be building a command line runner. We're going to implement FizzBuzz as a command line runner application. If you're not familiar with FizzBuzz, it is a very old school interview question to see how well you write something efficiently in a language. I don't really care how efficient you are. I'm going to show you a very efficient way to do this in the solution. What I do care about is that you use the command line runner to implement FizzBuzz. So let's talk about what FizzBuzz is. You are going to simply print all of the numbers between one and a hundred, something that we just did, minus the counting statement we put into it. However, if the number is divisible by three, instead of printing the number, you're going to print fizz instead. If the number is divisible by five, you're going to print buzz instead. Now, if it's divisible by both, print fizz buzz and that's the…