Académique Documents
Professionnel Documents
Culture Documents
In Focus
Who is a Microsoft Regional Director?
Wrapper Class in C#
Ask a Question Contribute
6 1 96.3k
Let's learn wrapper class today. Below is the formal bookish definition of Wrapper class.
another class or component. These are useful by providing a level of abstraction from the
Ok, let me give example from my experience. I have a class for TAX calculation containing method to calculate TAX, and my
another class called SALARY calculator is there. Now to calculate salary I want to use TAX calculator class. And my interest is
that I will not disclose to other class How I am calculating TAX?. Then I will simply wrap my TAX calculator class by SALARY
class.
components. Have a look of below code. Though it's another example one.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Data.SqlClient;
using System.Data;
using System.Diagnostics;
namespace BlogProject
{
class Wrapper //Wrapper Class
{
class InnerClass //Inner Class
{
public Int32 ProcessDataint Val
{
http://www.csharpcorner.com/blogs/wrapperclassincsharp1 1/4
5/9/2017 WrapperClassinC#
In
Focus return Val + 1;
Who is a} Microsoft Regional Director?
}
Ask a Question Contribute
public Int32 CallRapper
{
Wrapper.InnerClass wpr = new Wrapper.InnerClass; // Internally call to Wrapper class.
return wpr.ProcessData100;
}
}
class Program
{
static void Mainstring[] args
{
Wrapper w = new Wrapper;
Console.WriteLine"Data Process by inner class and show by Wrapper Class:" + w.CallRapper;
Console.ReadLine;
}
}
}
Download 100% FREE Spire Oce APIs
Sourav Kayal
Visit my personal blog for latest and exciting articles of .NET/C#/Angular.Js and many more
http://ctrlcvprogrammer.blogspot.in/
http://ctrlcvprogrammer.blogspot.in/
31 8.6m 2
6 1
Type your comment here and press Enter Key (Minimum 18 characters)
thanks
sushil hadage Mar 04, 2015
1405 2 0 1 0 Reply
Comment Using
http://www.csharpcorner.com/blogs/wrapperclassincsharp1 2/4
5/9/2017 WrapperClassinC#
In Focus
0Comments Sortby Oldest
Who is a Microsoft Regional Director?
FacebookCommentsPlugin
LATEST BLOGS
Table With Sorting Using AngularJS
View All
Follow@csharpcorner 91.4Kfollowers
http://www.csharpcorner.com/blogs/wrapperclassincsharp1 3/4
5/9/2017 WrapperClassinC#
In Focus
C#Corner
Who is a Microsoft Regional Director?
1,284,200likes
LikePage LearnMore
6friendslikethis
Philadelphia
New York
London
Delhi
Join C# Corner
A community of 2.3 million developers worldwide.
Learn ASP.NET MVC Learn ASP.NET Core Learn Python Learn JavaScript Learn Xamarin
Learn Oracle More...
Home Events Consultants Jobs Career Advice Stories
About Us Contact Us Privacy Policy Terms Media Kit Sitemap Report a Bug FAQ
2017 C# Corner. All contents are copyright of their authors.
http://www.csharpcorner.com/blogs/wrapperclassincsharp1 4/4