Hi!
Which way is the more effective? Is there any difference?
If I give value to a variable in the class
public class A{
int a = 3;
}
or if I give value to a variable in the constructor of the class
public class A{
int a;
public A(){a=3;}
}
Is there any difference if the variable is a primitive type or an object?
Thanks.