Just wondering about the reason of compiling code like this:
class MyClass extends AnotherClass {
{
MySecondClass object = new MySecondClass();
object.doSomething();
}
}
Whats the difference between this code and code in constructor? This code executes before the object creation.
See Question&Answers more detail:os