Setter Injection:

After instantiating youíre Bean with no-argument constructor or no argument static factory method setter methods on bean can be invoked.

Java Code:
public class Sample {
   
   // the sample has a dependency on the item
   private Item item;

   // a setter method so that the Spring container can 'inject' a item
   public void setMoveFinder(Item item)
   {
       this.item = item;
   }
}

Constructor Injection:

The following code is the example of the Constructor Injection.

Java Code:
public class Sample 
{

   // the sample  has a dependency on the item
   private Item item;

   // a setter method so that the Spring container can 'inject' a item
   public  Sample(Item item)
   {
       this.item = item;
   }

}