I have the following bean but he value of add is 0.0. But when I take off the @Value annotation and hard code the values it works.
What is wrong
public class MyBean{
@Value("${app.intA}")
private double a;
@Value("${app.intB}")
private double b;
private double add = a+b;
public double getA(){
return a; // gives 2.4
}
public double getB(){
return b; // gives 1.5
}
public double getAdd(){
return add; // always 0.0
}
}