SlideShare a Scribd company logo
2
Most read
3
Most read
7
Most read
Array in c#
 Array are the homogeneous(similar) collection of data types.
 Array Size remains same once created.
 Simple Declaration format for creating an array
type [ ] identifier = new type [integral value];
 You declare an array variable by specifying:
◦ The element type of the array.
◦ The rank of the array.
◦ The name of the variable
This specifies the rank of the
array
This specifies the name of the array variable
This specifies the element type of the
array
type[ ] name;
Array in c#
Methods of creating and initializing arrays at compile time
Array
Single Dimensional
Array Multi-Dimensional Array
Jagged Array
 The one dimensional array or single
dimensional array in C# is the simplest type
of array that contains only one row for
storing data.
 Declaration: double[] balance = new
double[10];
int [] marks = new int[2] { 99, 98, 92, 97, 95};
int[] score = marks;
 Multi-dimensional arrays are also called
rectangular array.
 Stored sequentially.
 It contains more than one rows.
 Declaration: type[,] array = new type[9, 9];
array[3,8] = 100;
string[,] array2Db = new string[3, 2]
{ { "one", "two" }, { "three", "four" }, { "five", "six"
} };
 A jagged array is an array whose elements are
arrays.
 The elements of a jagged array can be of
different dimensions and sizes.
 Declaration:
int[][] jaggedArray = new int[3][];
int[][,] jagged = new int[3][,]
{ new int[,] { {1,3}, {5,7} },
new int[,] { {0,2}, {4,6}, {8,10} },
new int[,] { {11,22}, {99,88}, {0,9} } };
Thank You
4/30/2019 13

More Related Content

What's hot (20)

PPTX
Event In JavaScript
ShahDhruv21
 
PPT
C# Basics
Sunil OS
 
PPS
Wrapper class
kamal kotecha
 
PPTX
Chapter 3 servlet & jsp
Jafar Nesargi
 
PPTX
Arrays in java
Arzath Areeff
 
PPT
Collection Framework in java
CPD INDIA
 
PPTX
Content provider in_android
PRITI TELMORE
 
PPTX
Ado.Net Tutorial
prabhu rajendran
 
PPTX
Constructor in java
Pavith Gunasekara
 
PPTX
Hibernate ppt
Aneega
 
PPTX
Static Data Members and Member Functions
MOHIT AGARWAL
 
PDF
JavaScript - Chapter 8 - Objects
WebStackAcademy
 
PPTX
Java swing
Apurbo Datta
 
PPTX
Java constructors
QUONTRASOLUTIONS
 
PPTX
Java abstract class & abstract methods
Shubham Dwivedi
 
PPTX
Inheritance in java
Tech_MX
 
PPS
Jdbc architecture and driver types ppt
kamal kotecha
 
PPT
Cookies in servlet
chauhankapil
 
PDF
JavaScript - Chapter 4 - Types and Statements
WebStackAcademy
 
PDF
Asp.net state management
priya Nithya
 
Event In JavaScript
ShahDhruv21
 
C# Basics
Sunil OS
 
Wrapper class
kamal kotecha
 
Chapter 3 servlet & jsp
Jafar Nesargi
 
Arrays in java
Arzath Areeff
 
Collection Framework in java
CPD INDIA
 
Content provider in_android
PRITI TELMORE
 
Ado.Net Tutorial
prabhu rajendran
 
Constructor in java
Pavith Gunasekara
 
Hibernate ppt
Aneega
 
Static Data Members and Member Functions
MOHIT AGARWAL
 
JavaScript - Chapter 8 - Objects
WebStackAcademy
 
Java swing
Apurbo Datta
 
Java constructors
QUONTRASOLUTIONS
 
Java abstract class & abstract methods
Shubham Dwivedi
 
Inheritance in java
Tech_MX
 
Jdbc architecture and driver types ppt
kamal kotecha
 
Cookies in servlet
chauhankapil
 
JavaScript - Chapter 4 - Types and Statements
WebStackAcademy
 
Asp.net state management
priya Nithya
 

Similar to Array in c# (20)

PPTX
Arrays in .Net Programming Language.pptx
vanithachezian
 
PPTX
Arrays
mohamedjahidameers
 
PPTX
Arrays.pptx
Mohit750936
 
PPTX
C# Lesson 3
Bohdan Pashkovskyi
 
PDF
Learn C# Programming - Nullables & Arrays
Eng Teong Cheah
 
PPTX
7array in c#
Sireesh K
 
PPT
CSharp_02_Arrays_fundamentals_concepts_introduction
Ranjithsingh20
 
PDF
Array and Collections in c#
Umar Farooq
 
PPTX
Arrays, Structures And Enums
Bhushan Mulmule
 
DOC
Arrays In General
martha leon
 
PPTX
Array
Allah Ditta
 
PPT
Visula C# Programming Lecture 5
Abou Bakr Ashraf
 
PDF
Intake 38 3
Mahmoud Ouf
 
DOCX
arrays.docx
lakshmanarao027MVGRC
 
PPTX
arrays in c# including Classes handling arrays
JayanthiM19
 
PPTX
ARRAYS.pptx
akila m
 
PPTX
Basic Arrays in C Programming Language I
ChobodiDamsaraniPadm
 
PPTX
Module 7 : Arrays
Prem Kumar Badri
 
Arrays in .Net Programming Language.pptx
vanithachezian
 
Arrays.pptx
Mohit750936
 
C# Lesson 3
Bohdan Pashkovskyi
 
Learn C# Programming - Nullables & Arrays
Eng Teong Cheah
 
7array in c#
Sireesh K
 
CSharp_02_Arrays_fundamentals_concepts_introduction
Ranjithsingh20
 
Array and Collections in c#
Umar Farooq
 
Arrays, Structures And Enums
Bhushan Mulmule
 
Arrays In General
martha leon
 
Visula C# Programming Lecture 5
Abou Bakr Ashraf
 
Intake 38 3
Mahmoud Ouf
 
arrays in c# including Classes handling arrays
JayanthiM19
 
ARRAYS.pptx
akila m
 
Basic Arrays in C Programming Language I
ChobodiDamsaraniPadm
 
Module 7 : Arrays
Prem Kumar Badri
 
Ad

More from Prem Kumar Badri (20)

PPTX
Module 15 attributes
Prem Kumar Badri
 
PPTX
Module 14 properties and indexers
Prem Kumar Badri
 
PPTX
Module 12 aggregation, namespaces, and advanced scope
Prem Kumar Badri
 
PPTX
Module 13 operators, delegates, and events
Prem Kumar Badri
 
PPTX
Module 11 : Inheritance
Prem Kumar Badri
 
PPTX
Module 10 : creating and destroying objects
Prem Kumar Badri
 
PPTX
Module 9 : using reference type variables
Prem Kumar Badri
 
PPTX
Module 8 : Implementing collections and generics
Prem Kumar Badri
 
PPTX
Module 6 : Essentials of Object Oriented Programming
Prem Kumar Badri
 
PPTX
Module 5 : Statements & Exceptions
Prem Kumar Badri
 
PPTX
Module 4 : methods & parameters
Prem Kumar Badri
 
PPTX
Module 3 : using value type variables
Prem Kumar Badri
 
PPTX
Module 2: Overview of c#
Prem Kumar Badri
 
PPTX
Module 1 : Overview of the Microsoft .NET Platform
Prem Kumar Badri
 
PPTX
C# Non generics collection
Prem Kumar Badri
 
PPTX
C# Multi threading
Prem Kumar Badri
 
PPT
C# Method overloading
Prem Kumar Badri
 
PPTX
C# Inheritance
Prem Kumar Badri
 
PPTX
C# Generic collections
Prem Kumar Badri
 
PPTX
C# Global Assembly Cache
Prem Kumar Badri
 
Module 15 attributes
Prem Kumar Badri
 
Module 14 properties and indexers
Prem Kumar Badri
 
Module 12 aggregation, namespaces, and advanced scope
Prem Kumar Badri
 
Module 13 operators, delegates, and events
Prem Kumar Badri
 
Module 11 : Inheritance
Prem Kumar Badri
 
Module 10 : creating and destroying objects
Prem Kumar Badri
 
Module 9 : using reference type variables
Prem Kumar Badri
 
Module 8 : Implementing collections and generics
Prem Kumar Badri
 
Module 6 : Essentials of Object Oriented Programming
Prem Kumar Badri
 
Module 5 : Statements & Exceptions
Prem Kumar Badri
 
Module 4 : methods & parameters
Prem Kumar Badri
 
Module 3 : using value type variables
Prem Kumar Badri
 
Module 2: Overview of c#
Prem Kumar Badri
 
Module 1 : Overview of the Microsoft .NET Platform
Prem Kumar Badri
 
C# Non generics collection
Prem Kumar Badri
 
C# Multi threading
Prem Kumar Badri
 
C# Method overloading
Prem Kumar Badri
 
C# Inheritance
Prem Kumar Badri
 
C# Generic collections
Prem Kumar Badri
 
C# Global Assembly Cache
Prem Kumar Badri
 
Ad

Recently uploaded (20)

PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PPTX
How to Set Maximum Difference Odoo 18 POS
Celine George
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PDF
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PDF
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PDF
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PPTX
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
How to Set Maximum Difference Odoo 18 POS
Celine George
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
Dimensions of Societal Planning in Commonism
StefanMz
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 

Array in c#

  • 2.  Array are the homogeneous(similar) collection of data types.  Array Size remains same once created.  Simple Declaration format for creating an array type [ ] identifier = new type [integral value];
  • 3.  You declare an array variable by specifying: ◦ The element type of the array. ◦ The rank of the array. ◦ The name of the variable This specifies the rank of the array This specifies the name of the array variable This specifies the element type of the array type[ ] name;
  • 5. Methods of creating and initializing arrays at compile time
  • 7.  The one dimensional array or single dimensional array in C# is the simplest type of array that contains only one row for storing data.  Declaration: double[] balance = new double[10];
  • 8. int [] marks = new int[2] { 99, 98, 92, 97, 95}; int[] score = marks;
  • 9.  Multi-dimensional arrays are also called rectangular array.  Stored sequentially.  It contains more than one rows.  Declaration: type[,] array = new type[9, 9]; array[3,8] = 100;
  • 10. string[,] array2Db = new string[3, 2] { { "one", "two" }, { "three", "four" }, { "five", "six" } };
  • 11.  A jagged array is an array whose elements are arrays.  The elements of a jagged array can be of different dimensions and sizes.  Declaration: int[][] jaggedArray = new int[3][];
  • 12. int[][,] jagged = new int[3][,] { new int[,] { {1,3}, {5,7} }, new int[,] { {0,2}, {4,6}, {8,10} }, new int[,] { {11,22}, {99,88}, {0,9} } };