title: @ConfigurationProperties vs @PropertySource vs @Value
body: <p>I am new to Spring/Spring Boot. I want to use the key-value pair data of <code>application.properties</code> / <code>application.yml</code> in Java file. I know that we can use <code>@Value</code> in any POJO class to set a default value of a field from <code>application.properties</code> or <code>application.yml</code> file.</p>
  <p>Q1) But then why do we need the other two? <code>@ConfigurationProperties</code> and <code>@PropertySource</code>.</p>
  <p>Q2) <code>@ConfigurationProperties</code> and <code>@PropertySource</code>, both can be used to load external data mentioned in <code>application.properties</code> or <code>application.yml</code> file? Or any restrictions?</p>
  <p>PS: I have tried to search on internet but didn't get a clear answer.</p>