Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9cc3074

Browse files
committed
spring core question
1 parent acf620b commit 9cc3074

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ At the beginning, it was the repository with questions from Java interviews. Cur
111111
- [How bean gets into the container?](spring.md#how-bean-gets-into-the-container)
112112
- [What are the possible bean scopes?](spring.md#what-are-the-possible-bean-scopes)
113113
- [What is the difference @Service between @Component?](spring.md#what-is-the-difference-service-between-component)
114+
- [What is the difference between @Service and @Bean](spring.md#what-is-the-difference-between-service-and-bean)
114115
- [How to call a method after bean initialization?](spring.md#how-to-call-a-method-after-bean-initialization)
115116
- [What is the default scope?](spring.md#what-is-the-default-scope)
116117
- [What is the prototype scope?](spring.md#what-is-the-prototype-scope)

spring.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- [How bean gets into the container?](#how-bean-gets-into-the-container)
55
- [What are the possible bean scopes?](#what-are-the-possible-bean-scopes)
66
- [What is the difference @Service between @Component?](#what-is-the-difference-service-between-component)
7+
- [What is the difference between @Service and @Bean](#what-is-the-difference-between-service-and-bean)
78
- [How to call a method after bean initialization?](#how-to-call-a-method-after-bean-initialization)
89
- [What is the default scope?](#what-is-the-default-scope)
910
- [What is the prototype scope?](#what-is-the-prototype-scope)
@@ -75,6 +76,9 @@ Apart from the fact that it's used to indicate, that it's holding the business l
7576
###### Relative links:
7677
+ https://stackoverflow.com/questions/6827752/whats-the-difference-between-component-repository-service-annotations-in
7778

79+
## What-is-the-difference-between-service-and-bean
80+
@Bean annotation is method-level and is used in configuration classes to fine tune special bean and add it to IoC container. @Service annotation is class-level and is used to show Spring that this class has to be managed by IoC container.
81+
7882
## How to call a method after bean initialization?
7983
+ afterPropertiesSet method;
8084
+ annotation @PostConstruct;

0 commit comments

Comments
 (0)