Spring Boot Framework Fresco Play MCQs Answers
Spring - Quiz
1.Which layer of spring boot spans across multiple layers?
- Common layer
- Service layer
- Foundation layer
- Web layer
Answer: 3)Foundation layer
2.Which interface implements Destruction callbacks?
- DisposableBean
- FinalizerBean
- DemolishBean
- None of the options
- DestructorBean
Answer: 1)DisposableBean
3.Which of the following methods performs the initialization of a bean?
- initialize
- init
- constructor
- afterPropertiesSet
Answer: 2)init
4.Which method should a bean implement to employ destruction callbacks?
- finalize
- clear
- destroy
- clean
Answer: 3)destroy
5.The following are valid techniques to offer configuration metadata to spring container, except ________
- XML-based configuration file
- Annotation-based configuration
- Java-based configuration
- JSON-based configuration file
Answer: 4)JSON-based configuration file
6.A session scope scopes the bean definition to an/the ____________
- HTTP request
- HTTP Application/Global session
- HTTP session
- Spring IoC container
Answer: 3)HTTP session
7.Which of the following is correct about dependency injection?
- It helps in deciding the dependencies of objects.
- It stores object states in the file system.
- It helps in decoupling application objects from each other.
- It stores object states in the database.
Answer: 3)It helps in decoupling application objects from each other.
8.Which interface helps to initialize the bean?
- BeanInitializer
- InitializingBean
- BeanInitializing
- InitializerBean
Answer: 2)InitializingBean
9.Which interface implements Destruction callbacks?
- FinalizerBean
- DemolishBean
- DisposableBean
- None of the options
- DestructorBean
Answer: 3)DisposableBean
- List of Fresco Play Courses without Hands-On | Fresco Play
- HMTL5 Semantics Elements MCQs Answers | Fresco Play
- HMTL5 Semantics Elements Hands-On Solutions | Fresco Play
- Styling with CSS3 Hands-On Solutions | Fresco Play
- Blockchain Intermedio MCQs Answers | Fresco Play
- Blockchain - Potentes Nexus MCQs Answers | Fresco Play
- Azure Essentials MCQs Answers | Fresco Play
- AWS Essentials MCQs Answers | Fresco Play
Spring Boot - Quiz
1.The default Java compiler level for a Spring boot app is __________
- Java 1.8
- Java 1.6
- Java 1.7
- None of the options
Answer: 2)Java 1.6
2.Spring boot application can be executed as a stand-alone jar.
- True
- False
Answer: 1)True
3.The Java compiler level can be modified for a Maven built Spring boot app using ____________
- server.properties
- application.properties
- pom.xml
- web.xml
Answer: 3)pom.xml
4.The annotation to be added to automatically configure beans based on the classes added to the class path is ____________
- None of the options
- @EnableAutoConfiguration
- @AutoConfiguration
- @EnableConfiguration
Answer: 2)@EnableAutoConfiguration
5.'Spring-boot-maven-plugin' is added to the pom.xml plugin section to _____________
- Package the spring boot application as an executable jar
- Build a maven Spring boot application
- None of the options
- Boot the maven Spring boot application
Answer: 1)Package the spring boot application as an executable jar
6.Executable jar can be created in Spring boot using __________
- Gradle build
- None of the options
- Both the options
- Maven build
Answer: 3)Both the options
7.What does SpringApplication.run() do?
- Performs class path scan (interprets all annotations in the Spring class)
- All the options
- Starts Spring Application Context
- Default configuration
- Starts Tomcat Server
Answer: 2)All the options
Build Systems - Quiz
1.Spring boot starter for a Spring batch application is ____________
- Spring-boot-starter-batch
- Spring-boot-batch
- Spring-starter-batch
- None of the options
Answer: 1)Spring-boot-starter-batch
2.Spring boot does not auto configure when a jar dependency is added outside the Starters package.
- True
- False
Answer: 2)False
3.What is the starter for using log4j2 for logging?
- Spring-boot-starter-log4j2
- Spring-boot-starter-logger
- Spring-boot-starter-log
- None of the options
Answer: 1)Spring-boot-starter-log4j2
4.Spring-boot-starter-parent allows to manage __________
- Default Plugin Configuration
- Configuration - Java Version and other properties
- None of the options
- Dependency Management - Version of dependencies
- All the options mentioned
Answer: 5)All the options mentioned
5.Dependencies cannot be added to the Gradle build system in Spring boot.
- True
- False
Answer: 2)False
Configuration - Quiz
1.Which annotation is used to bind application properties to the class fields?
- @AppProperties
- @ApplicationProperties
- None of the options
- @ConfigurationProperties
Answer: 4)@ConfigurationProperties
2.Specific Auto-Configuration classes cannot be disabled in Spring.
- True
- False
Answer: 2)False
3.@ConditionalOnClass({ DataSource.class, EmbeddedDatabaseType.class }) This configuration is only enabled when ________
- Class in present in the classpath
- Any of the options
- Java version 1.8 or above is used
- Maven is being used
- None of the options
Answer: 1)Class in present in the classpath
4.Auto-configuration report can be logged to the console by enabling debug mode while starting the application.
- False
- True
Answer: 2)True
5.The annotation used to import additional configuration classes is ___________
- @Include
- None of the options
- @EnableImport
- @Import
- Any of the options
Answer: 4)@Import
Spring Boot - Final Assessment
1.What is the scope for business service class in Spring MVC?
- Singleton
- request
- Prototype
- session
Answer: 1)Singleton
2.What is the role of ApplicationContextAware in Spring?
- To make bean aware on the container
- To perform Dependency injection
Answer: 1)To make bean aware on the container
3.What is the Starter that can be used to add spring boot dependency jars for a spring boot application?
- Spring-boot-parent
- Spring-boot-starter-parent
- Spring-boot-starter-web
- Any of the options
Answer: 2)Spring-boot-starter-parent
4.mvn dependency:tree command is used to print tree representation of project alone.
- True
- False
Answer: 2)False
5.The annotation to be added to automatically configure beans based on the classes added to the class path is ____________
- @AutoConfiguration
- @EnableAutoConfiguration
- @EnableConfiguration
- None of the options
Answer: 2)@EnableAutoConfiguration
6.@RequestMapping annotation is used to map a HTTP request method (GET or POST) to a specific class or method in the controller which will handle the respective request.
- False
- True
Answer: 2)True
7.After adding a starter to the pom.xml, we are free to pick and choose jar dependencies outside the starter.
- True
- False
Answer: 1)True
8.<java.version>1.8</java.version> is added under _________
- build
- dependencies
- properties
- plugins
Answer: 3)properties
9.Spring boot Actuator can be used to view ___________
- None of the options
- All the options mentioned
- Application bean configuration details
- Registered Health Check Metrics
- Application URL Mappings, Environment details and configuration parameter values
Answer: 2)All the options mentioned
10.The Gradle command to run a Spring boot executable app is ___________
- Gradle springBootRun
- gradle bootRun
- gradle run
- None of the options
Answer: 2)gradle bootRun
11.The Maven command to run a Spring boot application is __________
- mvn spring-boot:run
- maven spring-boot:run
- Mvn spring: run
- None of the options
Answer: 1)mvn spring-boot:run
12.The HTTP method to update a particular resource in Spring MVC is _____________
- Put
- None of the options
- Get
- Post
Answer: 1)Put
13.What is the default nature of the Beans defined in spring framework?
- None of the options
- Initialized
- Abstract
- Singleton
- Final
Answer: 4)Singleton
14.The property to set the host server port in Spring app is ____________
- host.port
- port name
- server.port
- server.portName
Answer: 3)server.port
15.The embedded server that starts up with the Spring boot application is ____________
- None of the options
- Tomcat server
- Weblogic server
- Server has to be configured
Answer: 2)Tomcat server
16.What is the scope of stateless bean in Spring?
- Request
- Singleton scope
- Session
- Prototype scope
Answer: 2)Singleton scope
17.Executable jar can be created in Spring boot using ______________
- Both the options
- Maven build
- None of the options
- Gradle build
Answer: 1)Both the options
18.The @Controller annotation indicates ____________
- How to control the dependency injection.
- How to control the transaction management.
- How to control the aspect programming.
- That a particular class serves the role of a controller.
Answer: 1)That a particular class serves the role of a controller.
19.For which of the following criteria can Spring boot auto configuration be done?
- Absence of configuration file
- Presence or absence of a Spring Bean
- Presence of a System Property
- All the options
- Availability of a particular class in classpath
Answer: 4)All the options
20.Which of the following layers the @Controller annotation is used in?
- Business layer
- Session layer
- Presentation layer
- None of the options
- Service layer
Answer: 3)Presentation layer
21.Spring boot follows Opinionated Defaults Configuration approach to reduce developer effort.
- True
- False
Answer: 1)True
22.How to get the object of DAO in spring framework?
- Using Spring Dependency injection
- Using new keyword
Answer: 1)Using Spring Dependency injection
23.@RequestMapping annotation is used to map a HTTP request method (GET or POST) to a specific class or method in the controller which will handle the respective request.
- True
- False
Answer: 1)True
24.By default, a bean is eagerly initialized in spring.
- True
- False
Answer: 1)True
- List of Fresco Play Courses without Hands-On | Fresco Play
- HMTL5 Semantics Elements MCQs Answers | Fresco Play
- HMTL5 Semantics Elements Hands-On Solutions | Fresco Play
- Styling with CSS3 Hands-On Solutions | Fresco Play
- Blockchain Intermedio MCQs Answers | Fresco Play
- Blockchain - Potentes Nexus MCQs Answers | Fresco Play
- Azure Essentials MCQs Answers | Fresco Play
- AWS Essentials MCQs Answers | Fresco Play