Why do we define the new fuction under public?

I understand that makes the function “InitGame” public. Is there a reason to make it public? Will it work (in the future) if I make it private?

Public allows another file to access the function.To make it work under private you need to add getters inside presumably the class you wrote the function in.A getter is what allows you to access the private function.

1 Like

Thank you for your reply. I will look up getters :+1:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms