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

We cannot create instances of static classes. Can we have constructors for static classes?

959


What is anonymous types in c#?

869


What is a boolean c#?

854


What is an Interface in C#?

947


What are the different types of constructors?

942


What is .net console?

948


Define delegate in c#?

889


Which program construct must return a value?

1015


What is the interface in c#?

921


What are modifiers in c#?

832


What is the use of delegates in c#?

849


Enlist some of the properties of a thread class?

886


Is vs as c#?

862


What is the Signification of the "new " keyword in C#? example

899


What are winforms in c#?

871