Is it possible to split inner classes to separate ...
# getting-started
d
Is it possible to split inner classes to separate files somehow?
t
All parts of a class definition must be in it's declaration/body. You can't split the class body across multiple files, so you also can't define inner classes anywhere else. IMO it also generally makes sense to have things that belong together so closely in the same spot.
d
That's sad, as I have several big classes that need access to same variables. Thanks anyway
t
You might consider having something like a shared "state object" that you pass into each of your classes so they can be defined separately but still share the same variables. I'd say that's cleaner anyway than using inner classes for that purpose.
👆 1
352 Views