What is the difference b/w Arry.copy() and array.clone()
method?
Answers were Sorted based on User's Feedback
Answer / vishalakshi patil
Array.copy() Copies a range of elements in one Array to
another Array and performs type casting and boxing as
required. Deep Copy
Return type Void
The Array.clone() is of the same Type as the original Array.
Shallow copy. Return type System.object
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / chauhan rakesh botad
Array.Copy() copies all contents of original array to
another array by specied index of original array while Clone
creates a shallow copy. Array.Copy() copies Data as well as
structure while Clone copies data only.
| Is This Answer Correct ? | 2 Yes | 0 No |
Array.Copy() is deep copy and Array.clone() is shallow copy.
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / chauhan rakesh botad
System.Array.copyto() will perform a deep copy of array
while system.array.Clone() will perform shalow copy of the
array.Shalow copy will simply copy the elements of the array
where as an Deep copy will copy the elements as well as any
referenced elements present in the array.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / vasanth
Array.copy() copies both structure and data to another array and its return type is void.
Array.Clone() copies only structure of array and its return type is Object.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sanjaym
Array.copy() and array.clone() both gives Deep copy.
The main difference is array.clone() return type is object
so type casting is required...
| Is This Answer Correct ? | 1 Yes | 5 No |
What is static void main in c#?
What is difference between method and function in c#?
when data member or member function is static is acess specifier is considered??
What is yield c#?
What are access modifiers used for?
How do you inherit from a class in C#?
Are c# strings null terminated?
Valuetype/reference type?
How do I know if executenonquery is successful c#?
What is collection of classes in c#?
How do you type a null character?
What is lazy loading c#?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)