C# how to access a method inside a object instance?

Hi guys. I am having trouble figuring out how to access a method that exists inside a object instance in C#. How can this be done? I know that in C++ this can be done using -> but I can not see how to do this in C#. Assume I have a object called myObject and in that object there is a method called myMethod.... show more Hi guys. I am having trouble figuring out how to access a method that exists inside a object instance in C#. How can this be done?

I know that in C++ this can be done using -> but I can not see how to do this in C#.

Assume I have a object called myObject and in that object there is a method called myMethod. How would I externally access myMethod?

Thank you in advance.
Update: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace S2Exercise2 { class mainClass { class One { int testInt = 51; } //Cls B with Cls A object and initialized class Two ... show more using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace S2Exercise2
{

class mainClass
{

class One
{
int testInt = 51;

}

//Cls B with Cls A object and initialized
class Two
{
One a1 = new One();

}
Update 2: static void Main()
{

Two Temp = new Two();

int var1 = Temp.a1.testInt; //This part here is not working

Console.WriteLine(var1);
Console.ReadLine(); //This stops the program so we can see the result.

}
}

}
Update 3: Got it :)

My god how missing one thing can mess you up so badly. I forgot to make things public. Thank you and Cheerio!
2 answers 2