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: 68Word Count: 427See All articles From Author

Computer Programming Articles

1. Top 6 Dating Apps Solo Travellers Should Download
Author: Pulkit Goel

2. Find A Decent Android App Developer And Ensure That Your Smartphones Don't Get Cluttered With Trash
Author: Daniel Carl

3. Finish Setup Of Selenium Grid 2.0 With Hub And Node Setup
Author: Siyaram Ray

4. How To Fix A 404 Not Found Error
Author: zaibi malik

5. Ways To Bypass Passcode Without Restoring Iphone
Author: Joey Williams

6. Fix For Pokémon Go Signal Issue
Author: Joey Williams

7. What If Selenium's Highlight Command Was Always On?
Author: Siyaram Ray

8. How To Start Your Programming Career

9. Amazon E-commerce Platform
Author: brilliant info

10. Why Is Web App Development Essential For Business?
Author: Vikram Patel

11. Basic Useful Tricks For New Android App Developers
Author: Daniel Carl

12. Ways To Hire A Skilled Web Developer
Author: CMTech

13. 10 Benefits Which Make C# Best Choice Over Other Dialects
Author: Techno Softwares

14. What Is Binary Informatics?
Author: Jonson wts

15. What’s The Impact Of Devops On Business Continuity?
Author: Amit Tiwari

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