• Business
  • Finance
  • Banking
  • Education
  • General
  • Law
  • Science
  • IT
  • English

Key Differences

Know the Differences & Comparisons

Difference Between Array and ArrayList in C#

Last updated on June 8, 2019 by Surbhi S

array and arraylistWhat is an Array

An array is a sequential collection of similar data that can be accessed as per the “index”. It is the simplest type of data structure in which the elements get stored in a contiguous memory location.

In Array, index starts at zero, so to access the first element of an array “numarray”, it should be written as numarray[0].

Example of Array in C#
arrayOutput:-
10  20  30  40  50

What is an ArrayList

The ArrayList is a collection of objects of same or different types. The size of an ArrayList can be dynamically increased or decreased as per the requirement. It works like an array but unlike array in ArrayList items can be dynamically allocated or deallocated, i.e you can add, remove, index, or search for data in a collection.

Example of ArrayList in C-Sharp
array-listOutput:-
123  abc  67  pqr  45

Difference Between Array and ArrayList

  1. Array stores data of the same type whereas ArrayList stores data in the form of the object which may be of different types.
  2. Size of an ArrayList grows dynamically while Array size remains static throughout the program.
  3. Insertion and deletion operation in ArrayList is slower than an Array.
  4. Arrays are strongly typed whereas ArrayLists are not strongly typed.
  5. Arrays belong to System.Array namespace whereas ArrayList belongs to System.Collections namespace.
  6. When choosing between Array and ArrayList, decide on the basis of their features that you want to implement.

Related Differences

  • Difference Between Its and It’s
  • Difference Between NYSE and NASDAQ
  • Difference Between Discount and Rebate
  • Difference Between Copyright and Trademark
  • Difference Between Active Voice and Passive Voice

You Might Also Like:

Difference Between Interface and Class abstract class vs interfaceDifference Between Abstract class and Interface in C# write vs writelineDifference Between Write and WriteLine rows vs columnsDifference Between Rows and Columns questionnaire vs interviewDifference Between Questionnaire and Interview Data Vs InformationDifference Between Data and Information

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Top 5 Differences

  • Difference Between PERT and CPM
  • Difference Between Micro and Macro Economics
  • Difference Between Developed Countries and Developing Countries
  • Difference Between Management and Administration
  • Difference Between Qualitative and Quantitative Research

Related Differences

  • Difference Between Its and It’s
  • Difference Between NYSE and NASDAQ
  • Difference Between Discount and Rebate
  • Difference Between Copyright and Trademark
  • Difference Between Active Voice and Passive Voice



New Additions

  • Difference Between Planning and Scheduling
  • Difference Between Audit Report and Audit Certificate
  • Difference Between Product-Based and Service-Based Companies
  • Difference Between Civil and Criminal Liability
  • Difference Between Agent and Servant
  • Difference Between Liquidated Damages and Penalty
  • Difference Between DMAIC and DMADV
  • Difference Between Value Analysis and Value Engineering
  • Difference Between Forecasting and Prediction
  • Difference Between Point and Arc Elasticity
fb-follow youtube follow

Copyright © 2022 · Key Differences · Contact Us · About Us · Privacy