using System;
class line
{
Public class point // What is the reason why public should be included in this part?
{
public int x;
}
public point starting = new point();
}
class C_sharp_book
{
public static void Main()
{
line mine = new line();
mine.starting.x = 3;
Console.WriteLine("{0}", mine.starting.x);
}
}
I've put a question on the comment!
c#
mine.starting.x = 3; This direct access to class member variables requires a public declaration. If you do not declare it public, you must approach it indirectly through the function.
© 2025 OneMinuteCode. All rights reserved.