public class MyProduct { private int _myHeight; private int _myWidth; private int _myLength; public int MyHeight { get {return _myHeight;} set {_myHeight = value;} } public int MyWidth { get {return _myWidth;} set {_myWidth = value;} } public int MyLength { get {return _myLength;} set {_myLength = value;} }
} public class MyMain { public void test() { MyProduct p1 = new MyProduct(); p1.MyWidth = 50; p1.MyLength = 200; p1.MyHeight = 20; } }
{
private int _myHeight;
private int _myWidth;
private int _myLength; public int MyHeight
{
get {return _myHeight;}
set {_myHeight = value;}
} public int MyWidth
{
get {return _myWidth;}
set {_myWidth = value;}
} public int MyLength
{
get {return _myLength;}
set {_myLength = value;}
}
} public class MyMain
{
public void test()
{
MyProduct p1 = new MyProduct();
p1.MyWidth = 50;
p1.MyLength = 200;
p1.MyHeight = 20;
}
}