String[] a = new string[10]

for(i=0; i<10; i++)
{
a[i] = i;
}

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

Ans: 1, 10, 11, 12

Answer Posted / suresh

ANS:11
VALUES ARE STORED IN ARRAY FROM 0.HERE STRING[].
HERE TOTAL I VALUE IS 10 AND IT IS STORED IN ARRAY INCLUDING
STARTING POINT.SO 10+1=11.SO

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Please explain what is immutability, what is it for and how is it codified?

771


What is .net code security?

800


What's the .net collection class that allows an element to be accessed using a unique key?

804


What are the different types of Classes in .NET?

849


Can you write a class without specifying namespace?

843


How viewstate is being formed and how it's stored on client in .net?

805


What are the properties of ADO.NET?

885


What does .net stand for?

796


What is meant by globalization?

797


How will you register com+ services?

1807


How do you instantiate a complex number?

826


If a dataset contains 100 rows, how to fetch rows between 5 and 15 only?

770


What are multicast delegates?

822


What is namespaces in .net?

873


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

727