Home
Q&A
Education
Technology
Credit
General
Health
Insurance
Questions
Ask a Question
What is a Jagged Array in C#?
Home
Technology
What is a Jagged Array in C#?
asked
Apr 1, 2021
in
Technology
by
JackTerrance
What is a Jagged Array in C#?
interview-question-answer
technology-questions-answers
1
Answer
0
votes
answered
Apr 1, 2021
by
JackTerrance
A jagged array is an array whose elements are arrays. The elements of a jagged array can be of different dimensions and sizes. A jagged array is sometimes called an "array of arrays."
A special type of array is introduced in C#. A Jagged Array is an array of an array in which the length of each array index can differ.
Example
int
[][] jagArray =
new
int
[5][];
In the above declaration, the rows are fixed in size. But columns are not specified as they can vary.
Declaring and initializing a jagged array.
int
[][] jaggedArray =
new
int
[5][];
jaggedArray[0] =
new
int
[3];
jaggedArray[1] =
new
int
[5];
jaggedArray[2] =
new
int
[2];
jaggedArray[3] =
new
int
[8];
jaggedArray[4] =
new
int
[10];
jaggedArray[0] =
new
int
[] { 3, 5, 7, };
jaggedArray[1] =
new
int
[] { 1, 0, 2, 4, 6 };
jaggedArray[2] =
new
int
[] { 1, 6 };
jaggedArray[3] =
new
int
[] { 1, 0, 2, 4, 6, 45, 67, 78 };
jaggedArray[4] =
new
int
[] { 1, 0, 2, 4, 6, 34, 54, 67, 87, 78 };
Related questions
0
votes
Q: How to make a Jagged Array?
Thinking like a simple array: Console.WriteLine("Number: "); int x = Convert.ToInt32(Console.ReadLine()) ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked
May 17, 2022
in
Education
by
JackTerrance
c#
0
votes
Q: How to make a Jagged Array?
Thinking like a simple array: Console.WriteLine("Number: "); int x = Convert.ToInt32(Console.ReadLine()) ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked
May 13, 2022
in
Education
by
JackTerrance
c#
0
votes
Q: How to make a Jagged Array?
Thinking like a simple array: Console.WriteLine("Number: "); int x = Convert.ToInt32(Console.ReadLine()) ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked
May 13, 2022
in
Education
by
JackTerrance
c#
0
votes
Q: How to make a Jagged Array?
Thinking like a simple array: Console.WriteLine("Number: "); int x = Convert.ToInt32(Console.ReadLine()) ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked
May 7, 2022
in
Education
by
JackTerrance
c#
0
votes
Q: Which of the following returns an array of ones with the same shape and type as a given array?
Which of the following returns an array of ones with the same shape and type as a given array? (a) all_like (b) ones_like (c) one_alike (d) all of the mentioned...
asked
Oct 9, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: The ________ function returns its argument with a modified shape, whereas the ________ method modifies the array itself.
The ________ function returns its argument with a modified shape, whereas the ________ method modifies the array itself. (a) ... (c) reshape2, resize (d) all of the mentioned...
asked
Oct 7, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: ndarray is also known as the alias array. (a) True (b) False
ndarray is also known as the alias array. (a) True (b) False...
asked
Oct 7, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: Which of the following method creates a new array object that looks at the same data?
Which of the following method creates a new array object that looks at the same data? (a) view (b) copy (c) paste (d) all of the mentioned...
asked
Oct 7, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: Point out the wrong statement. (a) Each universal function takes array inputs and produces array outputs (b) Broadcasting is used throughout NumPy to decide how to handle disparately shaped arrays
Point out the wrong statement. (a) Each universal function takes array inputs and produces array outputs (b) Broadcasting ... input arguments are ndarrays (d) All of the mentioned...
asked
Oct 7, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: How to convert ArrayList to Array and Array to ArrayList in JAVA?
How to convert ArrayList to Array and Array to ArrayList in JAVA?...
asked
May 27, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: What is the difference between the length of an Array and size of ArrayList in Java?
What is the difference between the length of an Array and size of ArrayList in Java?...
asked
May 27, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: What are the main differences between array and collection?
What are the main differences between array and collection?...
asked
May 26, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: In MongoDB, _________ is the operator limits the contents of an array field from the query.
In MongoDB, _________ is the operator limits the contents of an array field from the query. (1)$Match (2)$elemMatch (3)$slice...
asked
May 23, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: What Is A Numpy Array?
What Is A Numpy Array?...
asked
Apr 25, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: Create a two 2-D array. Plot it using matplotlib
Create a two 2-D array. Plot it using matplotlib...
asked
Apr 24, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
...