123ArticleOnline Logo
Welcome to 123ArticleOnline.com!

ALL >> Computer-Programming >> View Article

What Is C#?

By Author: Karan Singh
Total Articles: 6

With .NET Framework 2.0 Microsoft included another element named Generics. Generics influenced re-usability to highlight of protest introduction more grounded by enabling programmers to make different programming components like classes, interfaces, delegates, capacities and so on which manages the diverse sort of information without bargaining the sort security. It implies that programmers can make write safe capacities with adaptable information compose.

In .NET we have numerous inbuilt gathering classes accessible in System. Collection namespace. While working with these accumulation classes we confront some execution related issues.

These classes work with the ‘question’ information compose because of which these classes treat each esteem put away inside it as an Object.
That when whole number esteem is put away in it is verifiably changed over into a question write. This Process is called as Boxing.
While recovering information from the gathering, information is recovered as protest compose which should be type thrown to the particular sort. This procedure is called as unboxing.
Each time when you include or expel information from these accumulation boxing and unpacking is performed which prompts execution corruption and because of utilization of ‘protest’ information compose the accumulations are not type safe. To conquer these issues we need to have an instrument which is type safe and disposes of the requirement for boxing and unpacking and it is only ‘Generics’.

Suppose you want to create a Stack class for different data types. There are two ways you may perform this task:

Make diverse classes to execute stack which works for various information composes.
The other route is to make a stack class with ‘object’ as parameter. This approach is superior to anything the main approach yet has restrictions.
It debases the execution in light of the fact that each time while embeddings information the qualities are boxed and keeping in mind that recovering information should be unpacked.
You have to make a class which acknowledges an information compose as parameter in the precise brackets.Data writes are determined at the season of making object as delineated in the code given underneath.
Stack class is made with the Generic kind T where T is a placeholder it is supplanted with the real information write when we make question of stack class

Advantages of Generic:

Type safety
Improved performance
Better code re-usability
If you are looking for one of the best Computer training institutes in Pune then NIIT Pune is a place where all your searches end. NIIT Pune offers various computer and Banking courses, all under one roof. They have few of the best Teachers from the industry to teach the courses to their students.

Click on this link to read more: https://niitpune.com/blog/what-is-c/

Total Views: 38Word Count: 427See All articles From Author

Computer Programming Articles

1. How To Connect A Wired And Wireless Both Printer
Author: sara williams

2. Importance Of Angularjs For Next Project
Author: Siyaram Ray

3. How To Fix Aol Error 101?
Author: sara williams

4. Official Toshiba Support | Toshiba
Author: Toshiba Backup

5. Application Development – Benefits Of Angularjs 2
Author: Siyaram Ray

6. Decoding The Importance Of Jewellery Software For Businesses
Author: Danish Mehta

7. How To Hire The Best Magneto Developer At An Affordable Price
Author: Anderson Mairay

8. In Detail About Angular And Angular2
Author: Siyaram Ray

9. Why To Choose A Cloud Call Center Software?
Author: Matt Parker

10. Selenium Testing Trends To Be Known In 2018
Author: Siyaram Ray

11. Important Things That Should Be Known About Angularjs
Author: Siyaram Ray

12. Get Deleted Data Back Fast With Active@ File Recovery
Author: James A Ashton

13. Real-world Testing – Use Selenium Effectively
Author: Siyaram Ray

14. How Active@ Undelete Helps You Recover Lost Files
Author: Thom Henks

15. Training And Placement Company In Chennai
Author: pani raga

Login To Account
Login Email:
Forgot Password?
New User?
Sign Up Newsletter
Email Address: