can you please explain me difference between following two object declarations.
1) ClassA objClassA;
2) ClassA objClassA = new ClassA();
Difference between two object declaration
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

ShankeyRank #972 · 2.1K reputationPosted Nov 1, 2010, 11:36 PM EDT
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
Suthish NairRank #92 · 22.8K reputationPosted Nov 2, 2010, 12:05 AM EDT