An Array is a Ref Type? what about the array elements which
are value type(int,Float...etc)?
Answers were Sorted based on User's Feedback
Answer / vibz
the array elements are boxed to Object type internally.
Is This Answer Correct ? | 22 Yes | 4 No |
Answer / anand
address of value type elements (variables) were stored in
the array name, eg: For int value type you wil declare as:-
int[] arrayname=new int[];
here arrayname contains the address of the elements stored
in it.
int[] arrayname=new int[] {5,4,3,2,1};
arrayname denotes to the address of 5.
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / nishesh
Array is ref type bcoz it holds the address or refrence to the elements and whnever array is used it refers to that address
whereas int, float, double are value types bcoz they directly stores value.
another difference
whn we make changes in array it does not allocate any new memory to the array elements
but whn we make changes with value types they allocate new memory to the new result obtained
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / vikas toshaniwal
The refrence type always refer the value from other variable
but value type we pass the value to the variable
if the ref variable value is changed than it reflect ot
refrence type but value type don't have any refrence
Is This Answer Correct ? | 0 Yes | 0 No |
How to store image file in Sql server database?
4 Answers Unique Software Systems,
What is before string in c#?
What is the difference between string and stringbuilder in c#?
What is the functionality of break and continue in Visual Studio?
What is a ienumerator?
What is the gac, and where is it located?
coding for delegates?
What is a collection class in c#?
Why do we need to serialize data?
There were a lot of questions asked, so I will list the topic (and add a what is "topic" and know pros/cons). Extreme programming, what is a transaction, various SDLC design approaches, what is a namespace, define a good test case, what is a stored proc, webservice? design patterns? linker? compiler? access modifiers? stack vs. queue? arrays vs. linked lists? sorting algorithms? recursion? OOP principles?
What is Implementation inheritance
Did it possible to cast a generic type of derived class to generic type of base class?