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

Is it true that objects don't always get destroyed immediately when the last reference goes away?

1 Answers  


Explain what is reflection in microsoft .net context?

1 Answers  


which methos do you invoke on the dataadapter control to load your generated dataset with data?

1 Answers  


What are the features of dot net?

1 Answers  


what is object lock?

1 Answers  


hai, about trading domain and need simple project on trading system. please help me...

1 Answers  


Define code access security (cas)?

1 Answers  


What's the problem with .net generics?

1 Answers  


Can we Classic ASP,.Net 1.0, .Net 1.x and .Net 2.0 installed on the same system?

2 Answers   Value Labs,


What is file extension of Webservices in .Net?

1 Answers   Arigo Infotech,


What is value type and refernce type in .net?

1 Answers  


what is AGILE SCRUM methodoly....?

1 Answers  


Categories