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

Explain about major components of the .NET framework.

1 Answers  


How do you instantiate a complex number?

0 Answers  


Explain the difference between asp.net and asp?

0 Answers  


Dynamic Fonts

0 Answers  


Is do-it (chennai) a good institute to learn dot-net???? are the trainers well experienced??

2 Answers   Satyam,






Explain how to redirect tracing to a file?

0 Answers  


What is Garbage Collection in .Net? Garbage collection process?

3 Answers  


Is there a way to suppress the finalize process inside the garbage collector forcibly in .net?

0 Answers  


When should I use .net core?

0 Answers  


What is an exe and a dll?

0 Answers  


What is Active Directory? What is the namespace used to access the Microsoft Active Directories?

3 Answers  


can any one tel me the complete Testing Procedure of any one simple PROJECT i mean either web/windows based application?

0 Answers  


Categories