Q:

Is it possible to use mother's object fields without passing them in method's arguments

Let's say we've got 2 classes:
public class object1
{
string hehe = "xd";
void function()
   {
   if (x != 5) {} // here!
   }
}

public class object2
{
int x;
int y;
object1 z;
}

I want to use x (From object 2) in a method in object1, which is stored in object2. Is that possible? I know, I can pass the data with method arguments but I'm wondering if its possible to avoid this somehow

A:

To access a property within another class you would need to either pass the instant of the object, or the value itself. Alternatively if the property is static, you can access it on the class definition. You'll also want to consider explicitly specifying the access modifier for your fields, properties and methods, so they're more "visible".
public class ClassOne
{
    public static int MyStaticInteger { get { return 1; } }

    public int x { get; set; }
    public int y { get; set; }
}

public class ClassTwo
{
    public const string hehe = "xd";

    public void doSomething(ClassOne myOtherClass)
    {
        if (myOtherClass.x != 5)
        {

        }

        if (ClassOne.MyStaticInteger != 5)
        {

        }
    }
}

