Reference types | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Reference types

How can I figure out whether datatype is referense type or not? And how can I create my own not reference datatype?

29th Jun 2016, 6:58 PM
Максим Кошевой
Максим Кошевой - avatar
2 Answers
+ 2
public bool IsValueType<T>() { return typeof(T).IsValueType; }
6th Jul 2016, 6:09 PM
Mark Angelo Rivo
Mark Angelo Rivo - avatar
0
As per I know string is reference type another datatype are value like int float char. If u want to create own value type you can create structs
30th Jun 2016, 5:36 AM
nitin sharma
nitin sharma - avatar