Spring Boot Test 1 — Questions and Answers
Question 1: What is Spring
- Java Framework (Correct answer)
- Web Development Framework (Correct answer)
- MVC Framework (Correct answer)
- None of the above
Correct answer: Java Framework
Explanation: <br> Spring Boot is a Java-based open source framework for building microservices. Pivotal Team created it, and it's used to create standalone and production-ready spring apps.
Question 2: What is the purpose of a repository?
- Store Variable
- Connect HTML with Java
- Getting data from the Database (Correct answer)
- None of the above
Correct answer: Getting data from the Database
Explanation: <br> A repository is a typical tool in scientific research that may also be used to manage business data. A data repository can also be referred to as a data library or archive. This is a broad phrase that refers to a data set that has been isolated for the purpose of data reporting and analysis.
Question 3: In spring boot, what is the default HTML template engine?
- Thymeleaf (Correct answer)
- JSP
- HTML
Correct answer: Thymeleaf
Explanation: <br> Thymeleaf is a web application framework built on Java. It works well with XHTML/HTML5 in web applications. Thymeleaf creates well-formed XML files from your files.
Question 4: What is the Rest Controller's Annotation?
- @SpringBootApplication
- @Restcontroller
- @Controller
- @RestController (Correct answer)
Correct answer: @RestController
The anotation for the Rest Controller is @RestController.
Question 5: What is the prefix for Thymeleaf in HTML?
- th:value
- TH:
- c:
- th: (Correct answer)
Correct answer: th:
The prefix used in HTML for Thmeleaf is th:
Question 6: In spring boot, which of the following can be used to manage dependencies?
- Gradle (Correct answer)
- Maven (Correct answer)
- Spring
- None of the above
Correct answer: Gradle
Explanation: <br> Maven and Gradle are popular build tools for managing dependencies, building, and packaging applications. We can also use those tools to execute a spring boot application while it is being developed.
Question 7: Maven utilizes which of the following?
- config.xml
- META-INF
- pom.xml (Correct answer)
- None of the Above
Correct answer: pom.xml
Explanation: <br> The pom.xml file includes project and configuration information for Maven to build the project, such as dependencies, build directory, source directory, test source directory, plugin, and goals, among other things. Maven first reads the pom.xml file before running the goal.
Question 8: What is the best way to include a dependency in a project?
- Add dependency inside pom.xml file (Correct answer)
- Copy & Paste the .Jar file inside src folder
- None of the Above
Correct answer: Add dependency inside pom.xml file
Explanation: <br> By inserting the dependency into the pom.xml file
Question 9: What exactly is an ORM?
- Alternative to JDBC
- Object Relational Mapper (Correct answer)
Correct answer: Object Relational Mapper
Explanation: <br> An object-relational mapper (ORM) is a library of code that automates the conversion of data from relational database tables to objects that may be utilized in application code
What is Spring