Learning C# for Unity, need help...

I’m following this tutorial, which has been fine up until chapter 3.

I’m getting errors when I try to set x and y of object home to anything, and also when I call Translate or set description.

public class Point
{
	public int x;
	public int y;
	
	public Point(int ix, int iy)
	{
		x = ix;
		y = iy;
	}
	
	public void Translate(int dx, int dy)
	{
		x += dx;
		y += dy;
	}
	Point p = new Point(2, 3);
	p.Translate(1, 1);
}

Unexpected symbol ‘(’ in class, struct or interface member declaration - when I try to ‘translate’

public class Location : Point
{
	public string description = "";
	
	Location home = new Location();
	home.description = "Home";
	home.x = 0;
	home.y = 0;
}

Unexpected symbol ‘=’ in class, struct or interface member declaration

how can I set/change the variables of an object…

Point p = new Point(2, 3);
p.Translate(1, 1);
Location home = new Location();
home.description = "Home";
home.x = 0;
home.y = 0;

Those lines need to be inside a method body, like:

public void CreatePoint(){
 Point p = new Point(2, 3);
 p.Translate(1, 1);
}

Outside of methods, you can only make declarations and initiations. To actually run code and manipulate objects, you need to run them inside a method, as Arterie explained.