vijay

vijay

  • NA
  • 43
  • 0

difference between two object declaration

Nov 2 2010 3:03 AM
can you please explain me difference between  following two object declarations.

1)     ClassA objClassA;

2)    ClassA objClassA = new ClassA();

Answers (2)

0
Suthish Nair

Suthish Nair

  • 0
  • 30.5k
  • 7.2m
Nov 2 2010 4:05 AM
refer msdn for full details
0
Shankey

Shankey

  • 0
  • 2.5k
  • 887.4k
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