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 trial2 Answers
Oliver Michaelsen
Courses Plus Student 1,166 PointsHello Pedro,
"pd" is just the name of the object that Craig created. You could call it pretty much anything you want, for example:
PezDispenser pedro = new PezDispenser("Hulk");
would simply create a new object called pedro which can be used to reference to the methods in your PezDispenser class. It would look something like this, assuming you know how method calls work:
System.out.printf("The Pez character is: %s %n", pedro.getCharacterName()); //getCharacterName is the method from you PezDispenser.java class.
As Craig also said in the video, "pd" might not be the best name to give the object as it could stand for multiple things such as "police department" and might confuse yourself later on or other developers that'll possibly work on your code with you.
I hope this eased it for you just a bit, let me and the others know if it helped you!
Alexis Beliveau
8,029 PointsI believe it stands for PezDispenser! (: