Box to object

image_pdfimage_print
   
 

class MyBoxingClass
{
    public static void DisplayMyCollection(params object[] anArray)
    {
        foreach (object obj in anArray)
        {
            System.Console.Write(obj + "	");
        }

        // Suspend the screen.
        System.Console.ReadLine();
    } 

    static void Main()
    {
        DisplayMyCollection(101, "Visual C# Basics", 2002);
    }
}

   
     


This entry was posted in Data Types. Bookmark the permalink.