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 is the procedure to add assemly to gac to make it shared one?

0 Answers  


What is the difference between response.write & response.output.write?

0 Answers  


What is file extension of Webservices in .Net?

0 Answers   Arigo Infotech,


How will you register com+ services?

0 Answers  


Explain the use of activex control in .net?

0 Answers  






Can a try block have nested try blocks?

0 Answers  


Do you know the difference between the stack and the heap?

0 Answers  


What should you do to store an object in a viewstate?

0 Answers  


What is il in vb.net?

0 Answers  


Which ports are used by viruses? UDP/TCP?

1 Answers  


How to customize the trace output?

0 Answers  


What is the best way to crack the certification?

0 Answers  


Categories