- using System.IO;
- using System;
- class ObjectClone
- {
- static void Main(string[] args)
- {
- int[] rollnumbers = {100, 200};
- int[] numbers = (int[])rollnumbers.Clone();
- numbers[0] = 300;
- Console.WriteLine("Roll Number {0}", rollnumbers[0]);
- Console.WriteLine("Clone Number {0}", numbers[0]);
- }
- }
Output:
Roll Number 100
Clone Number 300