✅ Access array in another class
I'm making an class to write arrays content which is in another class how can i access them ? (OOP)
6 Replies
Well, depends
Is it static? Access it with
ClassName.PropertyName
Is it not static? You'll need an instance@Angius
This is
Well those are local variables
So you cannot access them anywhere outside of this method
Can you help me to solve this issue please!
@Angius
You can use properties
Then you'll be able to access them from the instance of the class
Or you can make this method return what you need it to return
@Angius
I do it like this
Public static string [] BOOKS = new string [200]
Outside the method and it's worked !
Thank for giving hand 👏