What is the difference from
class Test {
A a = new A();
}
to
class Test {
static A a = new A();
}
Does the virtual machine perform differently in the initialization?
What is the difference from
class Test {
A a = new A();
}
to
class Test {
static A a = new A();
}
Does the virtual machine perform differently in the initialization?
In the first class there will be a member variable for each instance of the class Test. In the Second class there will be just one member variable for the whole class Test.