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 the generics and where used generics in your project?

Answer Posted / jo

generics is similar to templates in c++ language
by using generics we can delay the type creation

for example we want to swap to values by using swap method
like here int swap(int a=10,int b=5)
{
int temp;
temp=a;
a=b;
b=temp;
}
here we declare the type of variable a first where it is
declared and also we swap to string
swap(string s1="hi",string s2="bye")
{
sting =temp;
temp=s1;
s1=s2;
s2=temp;
}
where we write two methods for two diferent types but using
generics we can achve this simply
swap(<t>a ="hi"<t>b,="bye")
{
<t> temp;
temp=s1;
a=b;
b=temp;
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If you want to bind the columns manually within the asp:datagrid tags what kind of tags you have to add.

1093


What are the modes of updation in an updatepanel? What are triggers of an updatepanel?

1052


Why is xap important?

1063


What is application in asp net?

979


How you can stop the validation of ASP.NET controls from client side?

1095


What is a form tag?

934


What is use of <% %> in asp.net?

1056


Explain About WebService

1186


What is & in a url?

1011


How do you do client-side validation in .net? How to disable validator control by client side javascript?

1075


How to implement globalization and localization in the use interface in .net.

1069


Explain Session state management options in ASP.NET.

1141


Is web config mandatory?

1019


In early binding will the method invoked on com component will verify it?s existance in the system or not ?

2694


Write a code for passing ArrayList in Web API?

1608