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

Computer Programming Articles

1. Native Vs. Hybrid App Development: Which Approach To Choose In 2018?
Author: Alex Porubay

2. What To Do When Norton’s Firewall Block A Genuine Website?
Author: Daisy Matilda

3. Need Of Fundamental Web Development Knowledge
Author: Siyaram Ray

4. Data Analytics And Data Visualization - Job Opportunities
Author: pankaj singh

5. Creating Website – Essential Requirement For Web Development
Author: Siyaram Ray

6. Choosing The Right Technology For Your Mobile App
Author: Jules Arkley

7. Readymade Alibaba Clone Script For Next Generation
Author: Riya Dubay

8. Web Development – Top Programming Languages Needs To Learn
Author: Siyaram Ray

9. Why Redundancy, Scalability And High Availability Are Essential For Your Contact Center?
Author: Teckinfo

10. Ui Design Features For 2018
Author: Infocampus Logics Pvt Ltd

11. How Kids Can Enable Us To Wind Up Better Selenium Testers
Author: Siyaram Ray

12. Implementation Selenium Test Automation – Best Practices
Author: Siyaram Ray

13. Web Application Development – Useful Features Of Angularjs
Author: Siyaram Ray

14. Prerequisites Analysis – A Critical First Step In Web Development
Author: Siyaram Ray

15. Step By Step Instructions To Get Ready For Your Next Test Automation Interview
Author: Siyaram Ray

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