Possible Duplicate:
Instance variable initialization in java
Hello, can someone tell me what the difference / pros or cons of creating an object with the declaration of the class instance vars ie..
public class ClassName{
Object o = new Object();
}
to in the contructor
public class ClassName{
Object o;
public ClassName(){
o = new Object();
}
}
thank you!