Answer the question
In order to leave comments, you need to log in
Where does the entry occur when a method is called?
Hello everyone!
There is this code
class MyClass
{
private string field = null;
public void SetField(string value)
{
field = value;
}
public string GetField()
{
return field;
}
}
class Program
{
static void Main(string[] args)
{
MyClass inctance = new MyClass();
Console.WriteLine(inctance.GetField());
inctance.SetField("C вертушки!");
Console.WriteLine(inctance.GetField());
Console.ReadKey();
}
}
Answer the question
In order to leave comments, you need to log in
"only to the instance of the class that is in the inctance variable" -- right.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question