Data type practical in .Net

 using System;

class Boxing

{

public static void Main()

{

int a=10,b;

object o;

o=a; //boxing means here we have contain integer type value in object type

Console.WriteLine(o);

b=(int)o; //unboxing means here we have contain object type value in integer type

Console.WriteLine(b);

}

}












Comments

Popular posts from this blog

Map, MapGet, MapPost, MapPut and MapDelete methods in ASP.NET Core MVC - Routing ASP.NET

Layout View In ASP.NET Core 6 | _Layout.cshtml ASP.NET | Master Page ASP.Net Core

Attribute Routing in ASP.NET Core MVC