From the course: Learning Quarkus

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Fizz Buzz

Solution: Fizz Buzz

From the course: Learning Quarkus

Start my 1-month free trial

Solution: Fizz Buzz

(upbeat music) - [Instructor] And now, here's my solution to the challenge exercise. So I solved this problem with two class files and some changes to the application.properties of a brand new application. So I went ahead and created a FizzBuzz application, and in the CommandRunner class that I created, I annotated it with QuarkusMain on line 10. You will see that I implement QuarkusApplication on line 11. I also have a private instance of FizzBuzz and a private static final Logger. Now, I inject into the constructor an instance of FizzBuzz, and then I'm going to use that in our Run method along with a LOG.debug statement telling us that we're starting, and a LOG.debug telling us that we're ending. That way, we complete those parts of the requirements. Now, in the FizzBuzz execution method, you'll see that I have this ApplicationScoped. That way, I can inject it in on line seven. And then, on line 10, I create a…

Contents