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
Michael McDonald
2,877 PointsDo any of the Treehouse classes cover how to use java packages?
Do any of the Treehouse classes cover how to use java packages? I read the documentation from Oracle on this subject and didn't really understand it. It might be that modern IDEs make mastery of this subject unnecessary.
1 Answer
Craig Dennis
Treehouse TeacherI am going to cover it in the upcoming Java Data Structures course.
Can I help answer a specific question about them now?
Michael McDonald
2,877 PointsMichael McDonald
2,877 PointsDoes adding a package name to a class make it available for import in other applications or classes? Where do packages get held? The compiler has to find them somehow. Is there a root java package that depends on nothing? Why do java.lang and java.Activity and others seem to contain none of the basic java commands? Why are there so many red error indications in java.lang and java.Activity even though they are usable? If I forget what import statement is needed for a class I used before, how do I find it out? I realize that Android Studio is pretty good at telling me this anyhow, but it won't if I can't remember if it started with "find.., get.., start.., make.., etc." or if it's a "..factory, ..warehouse, ..container, ..collection, etc". I imagine that many packages are internal to a corporation and might not be well documented.
By the way, is Android Studio a general java IDE in that it can compile any code the gnu java compiler can?
Michael McDonald
2,877 PointsMichael McDonald
2,877 PointsAlso, how do packages, libraries, and modules differ?