C# Method Question

Asked 2 years ago, Updated 2 years ago, 36 views

        public void Hello()
        {
            Console.WriteLine("Hello");
        }

        public void NiceOne()
        {
            Hello(); 
            Console.WriteLine("LiceOne");
        }

Is it possible to access the instance method within the same class?

c#

2022-09-21 20:33

1 Answers

Access is unrestricted within the same class.

If you want to restrict, consider the access restrictors below.


2022-09-21 20:33

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.