what is difference between following variable usages
public class A{
B b= new B();
public void doSomething()
{
b.callme();
}
}
VS
public class A {
B b;
public void doSomething() {
b=new B();
b.callme();
}
}
if we have single "b" inside a class then which one is better practice and why. and under what circumstances one whould be used.