Let's learn wrapper class today. Below is the
formal bookish definition of Wrapper class.
A wrapper class is any class which "wraps" or "encapsulates" the functionality
of
another class or component. These are useful by providing a level of abstraction
from the
implementation of the underlying class or component;
Not much clear , Right ?
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

kemplliPosted May 21, 2025, 7:02 PM
Nice job bro!
Mandar PalsePosted Dec 4, 2018, 7:38 AM
Great! Thank you
SubashPosted Jan 30, 2018, 5:39 AM
Thanks for the information
sushil hadagePosted Mar 4, 2015, 3:04 AM
thanks