Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Java Objects Harnessing the Power of Objects Incrementing and Decrementing

omkar chendwankar
omkar chendwankar
1,668 Points

Its basic I should have asked it first,why mr. craig is operating between two folders example.java and pezdispenser.java

and I couldnt understand some point till now, are there more detailled videos

2 Answers

Brendon Butler
Brendon Butler
4,242 Points

They're files, not folders. And you do this for organization reasons. You can have all your classes in one file, but it would get very long and confusing.

Markus Amon
Markus Amon
709 Points

its orgaisation^^ in the real world u dont want 1 big ass code u want many small pieces that puzzle together in a programm :) its easyier to maintain^^ all of the dispenser is defined in PezDispenser.java while Example.java is exposed to the user of the programm

lets say u make a game^^

one file will be stitching together the user can do then u have Inventory.java that sets stuff like MAX_WEIGHT MAX_SLOTS etc. u dont want this to be changed by the user and if u ever gonna tweak the values u dont have to search for it^^