Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Local Development Environments Exploring Your IDE Importing External Code

Christopher Mlalazi
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Christopher Mlalazi
Front End Web Development Techdegree Graduate 17,305 Points

com.treehouse

Why are both Systemizer and Karaoke built in com.treehouse? I am trying to figure out what com.treehouse is. Does that mean that they are both housed in it? I hope my question is not confused, but I was thinking that is Karaoke is a new project, why does it now have it's own new folder that is not com.treehouse?

3 Answers

Well, if both in same project ... and it been a while since I checked this particular project; then think of it as "Your Project" and "His project", and you just convert the analogy to using two shopping 'carts' instead of 2 'bags'. in each carts there is a bunch of bags(modules)

Any time your start a project in Java (maven or gradel) you should assign a workspace for your project to avoid name collision.

Hello

Let try a simple every day analogy.

You are going to the store to but a can of tuna, and may some chip and , not to miss, a loaf of bread. You told your neighbor and he said ... wow man, buy same thing.

you go to the store and upon check out, you put your can of tuna, your chips and your loaf of bread in one bag. You label this bag com.mybag

then you take his can of tuna, his chips and his loaf of bread in one bag in a different bag and you label it com.hisbag.

now even though both bags contains same items (same code names), they can certainly identify which belong to you and which belongs to him

Packaging is not a Java thing ... it is a coding thing. It is in C#, Java, Python and you name it. to package related code in package to avoid name collision and to clearly identify which code (tuna can) you want to use in your code; and remember, the two example tuna cans have same name (same program name), but the tuna inside is not same ....

Hope this help clarify the concept.

Christopher Mlalazi
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Christopher Mlalazi
Front End Web Development Techdegree Graduate 17,305 Points

Thanks for the analogy Mark, and which exactly get’s back to my point on why the Karaoke and Systemizer modules both use com.treehouse. Here I am assuming that com.treehouse is the bag in the analogy, and almost assuming that if Karaoke is in com.treehouse, then Systemizer should be in let’s say com.treemansion?