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

How long does it take to learn c# for unity?

960


How can we set the class to be inherited, but prevent the method from being over-ridden?

1041


Can delegates be used as callbacks?

964


Is double a decimal?

1010


What does do in c#?

1055


What is dll in c#?

1120


Who is a accessibility modifier “protected internal” available to ?

1076


What is the purpose of a constructor in c#?

924


Explain the various types of classes used in c#?

984


Is array thread safe c#?

923


Please explain the basic string operations used in c#?

1005


What is the difference between delegates and events in c#?

1057


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

1065


What are partial classes and use of partial classes?

999


Difference between StackPanel and RelativePanel ?

1067