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 does the XmlSerializer work? What ACL permissions does a process using it require?

2 Answers  


How can we create a website?

0 Answers  


Hi, I am developing an application (quiz engine) using C# in Dot net. My problem is I am designing the selction option using radio button. So, I want to retrive the data from the database to the radiobutton option. And also please tell me the how to compare the correct answer option with Answer selected by the users. If any body knows or have done this before please Help me out. My mail id is get_rome@yahoo.co.in. Table format: Question Id Queston Option1 Option 2 Option 3 Option 4 Correct answer 1 What is ur name? My name is ….. My name …. My name …. My name …. My name is tom

4 Answers  


How would you create a permanent cookie?

0 Answers  


What is asp.net with mvc? : Asp.Net MVC

0 Answers  


What is ViewState ? and how it is managed ?

1 Answers  


Contrast oop and soa. What are tenets of each16. How does the xmlserializer work? What acl permissions does a process using it require?

0 Answers  


How to create a db connection at one place/page so that we can use that connection for all pages/forms/windows.what r the steps ned to be performed if question not clear,let me know

0 Answers  


What are the different types of validation controls in asp.net?

0 Answers  


what is client-server architecture in .net? and what is 3-tier architecture?

1 Answers  


Explain the server control events of asp.net ?

0 Answers  


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

3 Answers  


Categories