title: Objects initialization in spring framework
body: <p>i am studying spring framework i have some doubts to confirm:</p>
  
  <ol>
  <li><p>I see that class objects are created as beans in xml file ... but my doubt is ... only pojo class beans need to be defined in xml for instatiation or all classes
  eg: my custom code class EncryptionUtil class that helps in encrypting data and so on custom logic classes also need to be instantiated using beans?This is my primary concern</p></li>
  <li><p>what about cases like i use</p>
  
  <pre><code>JSONObject j = new JSONOBJect() (External libs);
  ArrayList&lt;String&gt; a = new ArrayList&lt;String&gt;();
  </code></pre></li>
  </ol>
  
  <p>( java default object and collections)
  do these classes also need to have bean in xml?</p>
  
  <ol start="3">
  <li><p>i exactly dont know if spring ioc will instantiate each and every object or we need to instantiate only some objects
  also, in spring app does "new " keyword work for creating objects</p></li>
  <li><p>What should we use to instantiate bean in spring mvc ?
  ie : like i used ApplicationContext in my spring app , should i get bean everywhere i need</p></li>
  <li><p>will there be any problem if i use multiple annotations ie : of spring as well as hibernate on same class at same time?
  eg: something like this</p>
  
  <pre><code>@Id @GeneratedValue
  @Column(name = "id")
  private int id;
  </code></pre>
  
  <p>but if i want id to be autowired too ...</p>
  
  <p>@Autowired
  @Id @GeneratedValue
  @Column(name = "id")
  private int id;</p></li>
  </ol>
  
  <p>will this work?</p>