I have created few singleton bean in spring. I added log inside constructor. I could see log is getting printed twice. 

```
@Component
public class User{

        public User() {
         System.out.println(" Bean got initialized"+this);
       }  
        private Integer userid;

        private String username;

        //getter and setter

    }   

```

I have defined bean in XML and configured auto-scan.

```
<context:component-scan base-package="com.demo" />
<bean id="user" class="com.demo.User"/>

```

Since I have initialized bean in context xml and package scan, bean is getting initialized twice. After removing @Component from class, I am seeing only once log.

Please confirm my understanding is correct or not?