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

Okay, so an int is a value type, and a class is a reference type. How can int be derived from object?

0 Answers  


How many constructors can a class have c#?

0 Answers  


f i give input like 1,1,4,5,6,1,2,5,4,1,2, then output should be like : 1-4, 2-2, 4-2, 5-1, 6-1 which means 1 occurs 4 times, 2 occurs 2 times like so.

7 Answers  


What is public void in c#?

0 Answers  


explain the three services model commonly know as a three-tier application.

0 Answers   Siebel Systems,


What are extender provider components? Explain how to use an extender provider in the project.

0 Answers  


can a structure used in a class if yes then how.

2 Answers   Synechron,


What is parseexact c#?

0 Answers  


Are cao stateful in nature?

0 Answers  


What does == mean in c sharp?

0 Answers  


What is the difference between static class and singleton class in c#?

0 Answers  


How to Show Message box in Metro Style App?

0 Answers   PUCIT,


Categories