DateTime[] dt = new DateTime[10]

for(i=0; i<10; i++)
{
dt[i] = DateTime(2008, 1, i+1)
}

How many heap object will be created for the above array.
Choose the correct answer below.

Ans: 1, 10, 11, 12

Answers were Sorted based on User's Feedback



DateTime[] dt = new DateTime[10] for(i=0; i<10; i++) { dt[i] = DateTime(2008, 1, i+1) } ..

Answer / garima kurmi

Correct answer is 1.As the heap is a pointer and stores the
type of the object not the value.

Is This Answer Correct ?    4 Yes 0 No

DateTime[] dt = new DateTime[10] for(i=0; i<10; i++) { dt[i] = DateTime(2008, 1, i+1) } ..

Answer / shiva

10

Is This Answer Correct ?    2 Yes 2 No

DateTime[] dt = new DateTime[10] for(i=0; i<10; i++) { dt[i] = DateTime(2008, 1, i+1) } ..

Answer / rattan deep

answer is 11 because i+1 will give 11 value and in C# array
is considered as dynamic structure.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Dot Net General Interview Questions

What versions of .net are there?

0 Answers  


What is different between User Control and Web Control and Custom Control?

2 Answers  


The project which you have made, which methodology did you use?

0 Answers   Wipro,


What are Satellite Assemblies? How you will create this? How will you get the different language strings?

0 Answers   Reuters,


What is finalize method in .net?

0 Answers  


What does jit compilation do in .net?

0 Answers  


What is marshling?

0 Answers  


Explain the Scope of public/private/friend/protected/protected friend.

1 Answers   Wipro,


Explain about managed heap?

0 Answers  


Interop Services?

0 Answers  


Can you create instance of a class which has private constructor?

0 Answers  


What distributed process frameworks outside .NET do you know?

1 Answers  


Categories