Question: I was wondering if it was possible to do this, without using setters.

```
void Main()
{
    Point p = new Point();
    p.x = 7;
    Object o = p;
    ((Point)o).y = 9;   //  This doesnt work !
    ((Point)o).Print();

}

struct Point 
{
    public int x, y;
    public void Print() 
    {
        System.Console.WriteLine("x= "+this.x+"\ny= "+this.y);
    }
}

```

Is it possible to change the y value, just by casting, and unboxing?
thanks in advance

Answer: 
(Un)boxing *is a copy operation*. You're not modifying the value of your boxed structure, you're simply modifying a copy - which you throw away right after.

This has nothing to do with setters. You're simply modifying the wrong value :)

If you need to modify a boxed struct, you need to basically copy it manually, and then copy it back again:

```
var p2 = (Point)o;
p2.y = 9;
o = (object)p2;

```

Needless to say, this is a bit wasteful. If you really need to do something like this (and it's hard to see *why*), you might want to create a manual boxing object instead - something like

```
class MyBox<T> where T : struct
{
  public T Value;
}

```

Which allows you to do

```
var o = (object)new MyBox<Point> { Value = p };
((MyBox<Point>)o).Value.y = 9;

```

Note that `Value` is a *field* not a property - instead of copying, we're directly referencing the "boxed" value.
If you can change struct Point, what you can do is to make the Point implement an interface and later cast the boxed struct to the interface. This works because no unboxing happens when you cast the boxed point to the interface. 

Here's the sample code,

```
    public static void Main()
    {
        Point p = new Point();
        p.x = 7;
        object o = p;
        ((IModifiablePoint)o).Y = 9;   //  This works
        ((Point)o).Print();

    }

    interface IModifiablePoint
    {
        int X { get; set; }
        int Y { get; set; }
    }

    struct Point : IModifiablePoint
    {
        public int x, y;

        public int X
        {
            get { return x; }

            set { x = value; }
        }

        public int Y
        {
            get { return y; }

            set { y = value; }
        }

        public void Print()
        {
            System.Console.WriteLine("x= " + this.x + "\ny= " + this.y);
        }
    }
}

```