0
0
Spring Bootframework~10 mins

Running a Spring Boot application in Spring Boot - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start the Spring Boot application.

Spring Boot
public static void main(String[] args) {
    SpringApplication.[1](MyApplication.class, args);
}
Drag options to blanks, or click blank then click option'
Arun
Bexecute
Claunch
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using methods like start or launch which do not exist in SpringApplication.
Forgetting to pass the application class and args.
2fill in blank
medium

Complete the annotation to mark the main class as a Spring Boot application.

Spring Boot
@[1]
public class MyApplication {
    // main method here
}
Drag options to blanks, or click blank then click option'
AComponent
BSpringBootApplication
CService
DConfiguration
Attempts:
3 left
💡 Hint
Common Mistakes
Using @Component or @Service which are for beans, not the main application.
Forgetting to annotate the main class.
3fill in blank
hard

Fix the error in the main method to correctly start the application.

Spring Boot
public static void main(String[] args) {
    SpringApplication.[1];
}
Drag options to blanks, or click blank then click option'
Arun(MyApplication.class, args)
Bstart()
Claunch()
Dexecute()
Attempts:
3 left
💡 Hint
Common Mistakes
Calling run() without parameters causes errors.
Using non-existent methods like start or launch.
4fill in blank
hard

Fill both blanks to create a Spring Boot application main class with the correct annotation and main method call.

Spring Boot
@[1]
public class MyApplication {
    public static void main(String[] args) {
        SpringApplication.[2](MyApplication.class, args);
    }
}
Drag options to blanks, or click blank then click option'
ASpringBootApplication
BComponent
Crun
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong annotations like @Component.
Using non-existent methods like start.
5fill in blank
hard

Fill all three blanks to create a Spring Boot main class with annotation, main method, and run call.

Spring Boot
@[1]
public class [2] {
    public static void main(String[] args) {
        SpringApplication.[3]([2].class, args);
    }
}
Drag options to blanks, or click blank then click option'
ASpringBootApplication
BMyApplication
Crun
DApplication
Attempts:
3 left
💡 Hint
Common Mistakes
Mismatching class names.
Using wrong annotation or method names.