Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is type casting. Explain it with reference to classes.

Answer Posted / kiran vaidya

Type casting means converting some type to some another
type.

for example, there are three classes:

class Employee
{
//Logic for this class

}

class Manager:Employee
{
//Logic for this class

}

class Clerk:Employee
{
//Logic for this class

}


class Program
{
static void Main(string [] args)
{
Employee e=new Employee();


//Type casting
Manager m=(Manager)e;

//Or
Clerk c=(Clerk)e;

}

}

Is This Answer Correct ?    13 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define a manifest in .net?

993


What is the difference between properties and indexer in c#?

910


What is multicast delegate explain with example?

983


what is scope of a protected internal member variable of a c# class

1008


When should I throw an exception?

995


What is the difference between System.console.WriteLine() and System.console.Write() function?example?

1061


Suppose you have already existing application with Visual Studio 6 (VB 6, InterDev 6) and this application utilizes Windows 2000 COM+ transaction services. With this example how can you approach migrating this application to .NET?

888


For read-only operation which property you have to designated?

1024


What does int parse do in c#?

939


Is c# a keyword?

916


What is int32?

897


If you donot specify an access modifier for a method, what is the default access modifier?

1031


What are Namespaces?

1337


Why to use “using” in c#?

1056


What is cli in c#?

936