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

Why DLL files are needed. & how They are Created in DOTNET?

1 Answers  


Explain the difference between managed and unmanaged code?

0 Answers  


How .NET is able to support multiple languages?

5 Answers  


What is difference between system.string and system.stringbuilder classes?

0 Answers  


Explain how garbage collection works?

0 Answers  






What is the use of edititem template ingridview?

1 Answers   C Squared Systems, Microsoft,


What are the similarities and difference between class and structure in .net?

0 Answers  


What are the challenging issues you have faced in implementation project/Maintainance project in .net Functionality? How you have overcome that issue?

0 Answers   TCS,


How to implement datagrid in.net? How would you make a combo-box appear in one column of a datagrid? What are the ways to show data grid inside a data grid for a master details type of tables? If we write any code for datagrid methods. What is the access specifier used for that methods in the code behind file and why?

0 Answers  


Explain difference between panel and groupbox classes using .net?

0 Answers  


What is common language specification (cls)?

0 Answers  


How do you create threading in .NET? What is the namespace for that?

2 Answers  


Categories