Question: I have a static reference variable 

```
static IMail mailer = null;

```

to which I am assigning a value in the constructor of the class SearchManager

```
public SearchManager(ILog logger, String basePath, String indexPath, String nwId, IMail mailer) {
        this.logger = logger;
        this.basePath = basePath;
        this.indexPath = indexPath;
        this.nwId = nwId;
        this.mailer = mailer;
    } 

```

and I am using the mailer in my code. The constructor of this class might be called multiple times. So I have a query that how this static reference variable will behave each time the constructor is called. Will it take only the value which I passes when I called the constructor the first time or will it take different values each time I call the constructor?

Answer: 
> 
> Will it take only the value which I passes when I called the constructor the first time or will it take different values each time I call the constructor?
> 
> 
> 

It will take different values as it is shared by the instances, and each instance will see the same value off course.

As per the [JLS 8.3.1.1](http://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.3.1.1):

> 
> If a field is declared static, there exists exactly one incarnation of the field, no matter how many instances (possibly zero) of the class may eventually be created. A static field, sometimes called a class variable, is incarnated when the class is initialized
> 
> 
>
Value can be changed any time, but all instance have same and latest values.ie last time called