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 trialDerek Derek
8,744 Pointsimporting packages
Hello,
I'm not sure about the relationship between the directories/folders in which the .java files are saved and the package commands on each of the files.
For instance,
for Song.java and SongBook.java, it is "package com.teamtreehouse.model;" and these are stored in com/teamtreehouse/model.
for Karaoke.java it imports both of the files in com/teamtreehouse.model "import com.teamtreehouse.model.Song;" "import com.tremtreehouse.model.SongBook;"
for KaraokeMachine.java which is saved in com/teamtreehouse, it is "package com.teamtreehouse;"
My questions are
- why do the files have to be saved in different directories and how do we determine which one has to go where
- how does the location in which they are saved change the import package lines?
Thank you!
Jasper Peijer
45,009 PointsJasper Peijer
45,009 Pointsimport com.teamtreehouse.Apple;