Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is List a value type or a reference type? [duplicate]

Is List a value type or a reference type?

like image 400
behnam Avatar asked Apr 11 '16 20:04

behnam


3 Answers

List is a reference type since it's a class.

like image 114
Fabien ESCOFFIER Avatar answered Oct 27 '22 11:10

Fabien ESCOFFIER


List (a class) is a reference type. See:

  • Value Types
  • Reference Types
like image 8
BrunoLM Avatar answered Oct 27 '22 09:10

BrunoLM


the List is a class so it reference type

this class is Generic Class, you declare list of items the item type can be value type and reference type

like image 2
s-s Avatar answered Oct 27 '22 09:10

s-s