• Advertisement
Sign in to follow this  

Classes using each other

This topic is 3475 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey. Can I do something like this:
class TypeA{
    TypeB toTypeB{
        //code
    }
}

class TypeB{
    TypeA toTypeA{
        //code
    }
}

Share this post


Link to post
Share on other sites
Advertisement
If you're talking Java then yes you can. This is in fact a very common practice with respect to listeners and such.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement