Show List

Quiz - Spring - 3

74%

Public Average Score
Select the right answer for below questions:

What is the main use of the @Transactional annotation in Spring?
To manage transactions in the application.
To define a bean in the Spring configuration file.
To mark a class as a Spring bean.
To inject dependencies into a bean.
To manage transactions in the application.

What is the role of the @Service annotation in Spring?
To manage transactions in the application.
To define a bean in the Spring configuration file.
To inject dependencies into a bean.
To mark a class as a service class.
To mark a class as a service class.

What is the role of the @Repository annotation in Spring?
To mark a class as a repository class.
To manage transactions in the application.
To define a bean in the Spring configuration file.
To inject dependencies into a bean.
To mark a class as a repository class.

What is the main function of the @Controller annotation in Spring MVC?
To manage transactions in the application.
To define a bean in the Spring configuration file.
To mark a class as a controller class.
To inject dependencies into a bean.
To mark a class as a controller class.

What is the purpose of the @RequestMapping annotation in Spring MVC?
To map a database table to a Java class.
To map HTTP requests to specific methods in a controller class.
To define the scope of a bean in the Spring IoC container.
To secure a specific method in the application.
To map HTTP requests to specific methods in a controller class.

What is the role of the ModelAndView class in Spring MVC?
To handle exceptions in the application.
To manage transactions in the application.
To store data that needs to be displayed in the view.
To define a bean in the Spring configuration file.
To store data that needs to be displayed in the view.

What is the use of the @Qualifier annotation in Spring?
To define a primary bean among multiple beans of the same type.
To define the scope of a bean in the Spring IoC container.
To map HTTP requests to specific methods in a controller class.
To specify the bean to be injected when multiple beans of the same type are available.
To specify the bean to be injected when multiple beans of the same type are available.

What is the use of the @Value annotation in Spring?
To map a database table to a Java class.
To inject a value into a bean from the properties file.
To define a primary bean among multiple beans of the same type.
To handle exceptions in the application.
To inject a value into a bean from the properties file.

What is the role of the @RestController annotation in Spring MVC?
To map a database table to a Java class.
To handle exceptions in the application.
To define a bean in the Spring configuration file.
To create a RESTful web service.
To create a RESTful web service.

What is the purpose of the @ExceptionHandler annotation in Spring MVC?
To create a RESTful web service.
To map a database table to a Java class.
To handle exceptions in the application.
To define a bean in the Spring configuration file.
To handle exceptions in the application.

Submit
Retry
{"qz1-174685":"To manage transactions in the application.","qz1-174686":"To mark a class as a service class.","qz1-174687":"To mark a class as a repository class.","qz1-174688":"To mark a class as a controller class.","qz1-174689":"To map HTTP requests to specific methods in a controller class.","qz1-174690":"To store data that needs to be displayed in the view.","qz1-174691":"To specify the bean to be injected when multiple beans of the same type are available.","qz1-174692":"To inject a value into a bean from the properties file.","qz1-174693":"To create a RESTful web service.","qz1-174694":"To handle exceptions in the application."}

    Leave a Comment


  • captcha text