The singleton scope is a very common scope used in major applications. Here, we will start to use the singleton scope. First, we will create a bean class named EmailService, which consists of a simple getter/setter method and Constructor method with a print statement:
package com.packt.springbean;public class EmailService { private String emailContent; private String toAddress; public EmailService() { System.out.print(" \n Object of EmailService is Created !!! "); } public String getEmailContent() { return emailContent; } public void setEmailContent(String emailContent) { this.emailContent = emailContent; } public String getToAddress() { return toAddress; } public void setToAddress(String toAddress) { this.toAddress ...