can you please explain me difference between following two object declarations.
1) ClassA objClassA;
2) ClassA objClassA = new ClassA();
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Suthish NairPosted Nov 2, 2010, 4:05 AM
ShankeyPosted Nov 2, 2010, 3:36 AM
Hi vijay,
Their is a big diff. between these two statement.
For the first one no memory is allocated and for the second one the memory is allocated and along with this it will invoke constructors.
Please mark my answer as accepted if it clears you doubt