Does order of defining classes matter? #6009
Unanswered
pk1234pk1234dva-a11y
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Suppose you are declaring classes. Sometimes a method of one class returns another class. I wonder, is it needed for the class that is e.g. returned, to be defined before the method that uses it, or is the order irrelevant?
As an example:
This seems to work fine, despite
Bookbeing declared afterFindBook, whereFindBookreturnsBook*. So it seems that things are resolved in some deferred/lazy way. Still, I couldn't find documentation about this, and perhaps things are only working by chance.Can I rely on the order of class definitions being irrelevant, as far as return types and argument types go?
Beta Was this translation helpful? Give feedback.
All reactions