which datatype i have to use we i need dynamic size.for eg.
empname .in first row it have only five chars.but next row it
have 100 chars.

Answers were Sorted based on User's Feedback



which datatype i have to use we i need dynamic size.for eg. empname .in first row it have only five..

Answer / mahesh kotekar

When there is a requirement of storing different length of
characters in an array . We can use jagged arrays.
int[][] jagged = new int[3][];
jagged[0] = new int { 1,2,3 };
jagged[1] = new int { 1, 2, 3, 4, 5 };
jagged[3] = new int { 1, 2, 3, 4, 5, 6, 7, 8,9};

Is This Answer Correct ?    3 Yes 1 No

which datatype i have to use we i need dynamic size.for eg. empname .in first row it have only five..

Answer / radhika

i think we can use arraylist for dynamic size
for example
arraylist al= new arraylist();
al[0]="empname";
al[1]="empname is ............";

Is This Answer Correct ?    3 Yes 1 No

which datatype i have to use we i need dynamic size.for eg. empname .in first row it have only five..

Answer / kishore

we can use arraylist for dynamic size

Example:
Arraylist arlst=new Arraylist();
arlstl[0]="empname";
arlstl[1]="xyzz.........";

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More C Sharp Interview Questions

If a method's return type is void, can you use a return keyword in the method?

0 Answers  


Explain the difference between and xml documentation tag?

0 Answers  


State two different types of access modifiers.

0 Answers  


Why do we need constructor in c#?

0 Answers  


What is console read in c#?

0 Answers  






What are the valid parameter types we can pass in an Indexer ?

3 Answers   CMC,


What is the difference between String s(Small s) and String S(Capital S)?

4 Answers  


What is wrong with the sample program below?

0 Answers  


What is dataadapter c#?

0 Answers  


What is default value of decimal c#?

0 Answers  


What is difference between method overriding and method overloading?

0 Answers  


What is ildasm and obfuscator in net?

0 Answers  


Categories