0 votes
in Spring by

How can you ensure that only one instance of a bean is created in a Spring container?

a) Set bean scope to "singleton"

b) Set bean scope to "prototype"

c) Set bean scope to "global"

d) Use @OneInstance annotation

1 Answer

0 votes
by
a) Set bean scope to "singleton"

Explanation:

In Spring, the "singleton" scope ensures that only one instance of a bean is created in the container.
...