ankit
How many types of Wrapper classes in .NET?
By ankit in C# on May 29 2012
  • Ravindra Chaudhary
    Aug, 2015 4

    A wrapper class is "encapsulate" the resource. and restrict the interface between outside the world and encapsulate the object.public class Wrapper {private int x = 10;private int y = 20;public Wrapper(){//// TODO: Add constructor logic here//}public int add(int x, int y){Wrapper.inside obj = new inside();//core functionality of this method is written in the wrapped class.int sum = obj.add(x, y);return sum;}/// /// this class is wrapped by the wrapper class. /// we can access only inside this class./// outside the class, we cant access this class./// private class inside{ public int add(int x, int y){return x + y;} } }

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS