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 Generic? explain clearly?

Answers were Sorted based on User's Feedback



What is Generic? explain clearly?..

Answer / mithun

By using a generic class, we can create classes that is type safe at compile time.

ArrayList is a highly convenient collection class that can be used without modification to store any reference or value type. Any reference or value type that is added to an ArrayList is implicitly upcast to Object. If the items are value types, they must be boxed when they are added to the list, and unboxed when they are retrieved. Both the casting and the boxing and unboxing operations decrease performance

ArrayList list = new ArrayList();
list.Add(3);
list.Add("It is raining in Redmond.");
int t = 0;
foreach (int x in list)
{
t += x;
}

This will cause a programming error, and this error will not be detected until runtime.


In the generic List<T> collection, the same operation of adding items to the collection
List<int> list1 = new List<int>();
list1.Add(3);
list1.Add("It is raining in Redmond."); // this gives Compile-time error.

Now you can create a list that is not only safer than ArrayList, but also significantly faster, especially when the list items are value types.

Is This Answer Correct ?    2 Yes 0 No

What is Generic? explain clearly?..

Answer / dhanunjaya

generic is a general data type in c# similar to template in
c++.by using generic we can assign any type of value to the
generic variable.we have generic methods,generic classes
also.

Is This Answer Correct ?    2 Yes 2 No

What is Generic? explain clearly?..

Answer / tejkrishna

Generics are the type like list<> collection but it can
contain any type within it like list<t>.

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More ASP.NET Interview Questions

How do we ensure view state has not tampered?

0 Answers  


What is a url string?

0 Answers  


What is application variable and when it is initialized ?

4 Answers   Keane India Ltd,


How we can force all the validation controls to run?

0 Answers  


Asp.Net Source :- In my project i have gridview control - item template. Its have asp:button control. my requirement is while click this button i need to display some alert message. Could you please help me which gridview event i need to write source code? Please give me a quick response. Thanks

6 Answers  


whats the purpose of AUTOPOSTBACK property for the controls in asp.net?

4 Answers  


how to create textboxes dynamically and insert textbox text into sql database

2 Answers   AGiSAC,


Explain file-based dependency and key-based dependency.

0 Answers   MindCracker,


What are the contents of cookie?

0 Answers  


Which template must you provide, in order to display data in a Repeater control?

3 Answers  


What are cao and sao.

0 Answers  


What are strong names?

0 Answers  


Categories