🤑 Join the Treehouse affiliate program and earn 25% recurring commission!

New No-Code Track! 🚀 New videos dropping every week—start learning today!

🌟 Dreaming of a bright future? 🎓 Ask about the Treehouse Scholarship program! 🚀

✨ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

  • Treehouse Logo
  • Plans
    Chevron
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
  • Library
    Chevron
    • All Courses
    • Tracks
    • College Credit
  • Techdegree
    Chevron
    • Overview
    • Front End Development
    • Full Stack JavaScript
    • Data Analysis
    • UX Design
    • Python
  • Community
    Chevron
    • Community Projects
    • Live Sessions
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
  • Resources
    Chevron
    • Career Toolbox
    • CodeForward
    • Free Treehouse Near Me
    • Jobs
    • Blog
    • Support
    • About
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks College Credit
  • Overview Front End Web Development Full Stack JavaScript Python Development Data Analysis UX Design
  • Community Projects Live Sessions Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Career Toolbox CodeForward Free Treehouse Near Me Jobs Blog Support About
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • Android
      • • APIs
      • • Coding for Kids
      • • College Credit
      • • Computer Science
      • • CSS
      • • Data Analysis
      • • Databases
      • • Design
      • • Development Tools
      • • Digital Literacy
      • • Game Development
      • • Go Language
      • • HTML
      • • Java
      • • JavaScript
      • • Learning Resources
      • • Machine Learning
      • • No-Code
      • • PHP
      • • Professional Growth
      • • Python
      • • Quality Assurance
      • • React
      • • Ruby
      • • Security
      • • Swift
  • Christina Vieau
    Christina Vieau
    679 Points

    Error when trying to compile PezDispenser

    Posted December 3, 2023 5:02pm by Christina Vieau
    Christina Vieau
    679 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    0 Answers

  • Michel Spaniolo
    PLUS
    Michel Spaniolo
    Courses Plus Student 1,850 Points

    Yes im having trouble compiling.Maybe a hint at what im doing wrong would and has helped

    Posted May 24, 2022 9:49am by Michel Spaniolo
    Michel Spaniolo
    Courses Plus Student 1,850 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    2 Answers

  • elineurycollado
    elineurycollado
    631 Points

    The "Chomp" in my code continues to loop and I don't seem to understand why that is.

    Posted November 24, 2020 1:35am by elineurycollado
    elineurycollado
    631 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    1 Answer

  • Shaun Wetzel
    Shaun Wetzel
    9,085 Points

    PezDispenser pd = new PezDispenser("Yoda");

    Posted April 11, 2020 3:15pm by Shaun Wetzel
    Shaun Wetzel
    9,085 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    1 Answer

  • Dinu Comendant
    Dinu Comendant
    6,049 Points

    Exercise error, or I don't fully understand something here?

    Posted January 20, 2019 11:56pm by Dinu Comendant
    Dinu Comendant
    6,049 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    1 Answer

  • Jamie Thomasson
    Jamie Thomasson
    633 Points

    why cant i run code when i give dispenser.fill an argument?

    Posted November 17, 2018 12:55am by Jamie Thomasson
    Jamie Thomasson
    633 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    1 Answer

  • Victor Curtis Jr
    Victor Curtis Jr
    5,268 Points

    Shift Tab Not Working to Bring Up Different Methods in Jshell

    Posted November 5, 2018 9:50pm by Victor Curtis Jr
    Victor Curtis Jr
    5,268 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    2 Answers

  • Zak Manz
    Zak Manz
    1,390 Points

    Unable to call the PezDispenser pd = new PezDispenser("Yoda"); in Jshell

    Posted September 30, 2018 1:20am by Zak Manz
    Zak Manz
    1,390 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    2 Answers

  • kevin salinas
    kevin salinas
    2,392 Points

    how do you know when to use void in a method?

    Posted September 19, 2018 1:09am by kevin salinas
    kevin salinas
    2,392 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    1 Answer

  • Magnus Dilling Pettersen
    Magnus Dilling Pettersen
    5,681 Points

    Why am I only getting two PEZ, when I should have gotten six?

    Posted July 5, 2018 2:24pm by Magnus Dilling Pettersen
    Magnus Dilling Pettersen
    5,681 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    1 Answer

  • Thomas Rossini
    Thomas Rossini
    544 Points

    ()) purpose?

    Posted June 14, 2018 11:18pm by Thomas Rossini
    Thomas Rossini
    544 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    1 Answer

  • hamdan hassan
    PLUS
    hamdan hassan
    Courses Plus Student 640 Points

    can someone explain this

    Posted April 6, 2018 10:22am by hamdan hassan
    hamdan hassan
    Courses Plus Student 640 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    2 Answers

  • Siddesh Gannu
    Siddesh Gannu
    3,565 Points

    Method overloading with same parameters in different order

    Posted March 10, 2018 5:48pm by Siddesh Gannu
    Siddesh Gannu
    3,565 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    1 Answer

  • Tony Capps
    Tony Capps
    2,123 Points

    jshell not working

    Posted December 26, 2017 11:39pm by Tony Capps
    Tony Capps
    2,123 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    0 Answers

  • Anika Mehta
    Anika Mehta
    107 Points

    Why did he change first fill() method?

    Posted November 28, 2017 6:06am by Anika Mehta
    Anika Mehta
    107 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    1 Answer

  • Akhil Matabudul
    Akhil Matabudul
    2,386 Points

    Teacher's Notes

    Posted November 6, 2017 11:50am by Akhil Matabudul
    Akhil Matabudul
    2,386 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    1 Answer

  • Daniel Savin
    Daniel Savin
    768 Points

    Console outputs "Example.java:30: error: reached end of file while parsing" When I run the code.

    Posted October 7, 2017 8:00pm by Daniel Savin
    Daniel Savin
    768 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    1 Answer

  • Devin Wilson
    Devin Wilson
    593 Points

    Error using Shift TAB

    Posted August 10, 2017 11:04pm by Devin Wilson
    Devin Wilson
    593 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    4 Answers

  • John Anselmo
    PLUS
    John Anselmo
    Courses Plus Student 2,281 Points

    error: class, interface, or enum expected

    Posted August 3, 2017 9:20pm by John Anselmo
    John Anselmo
    Courses Plus Student 2,281 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    2 Answers

  • Edward Shim
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Edward Shim
    Java Web Development Techdegree Student 761 Points

    Why does the "dispense" method have to be a boolean?

    Posted May 18, 2017 5:12pm by Edward Shim
    .a{fill-rule:evenodd;}techdegree
    Edward Shim
    Java Web Development Techdegree Student 761 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    2 Answers

  • Sean Loke
    Sean Loke
    14,659 Points

    VERY CONFUSED WITH - fill(MAX_PEZ); and Challenge Task (GoKart)

    Posted April 18, 2017 1:47pm by Sean Loke
    Sean Loke
    14,659 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    2 Answers

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

    Too much information

    Posted December 29, 2016 7:37am by Christopher Mlalazi
    .a{fill-rule:evenodd;}techdegree seal-36
    Christopher Mlalazi
    Front End Web Development Techdegree Graduate 17,305 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading

    12 Answers

Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.

    Treehouse

  • About
  • Blog
  • Careers
  • Community
  • Stories
  • Shop
  • Contact
  • Gift Card

See Full Catalogue

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
  • Python Development
  • Data Analysis
  • UX Design

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
  • ...see more

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
  • ...see more

Explore

  • Plans
  • Affiliates
  • Perks
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
Terms & Conditions | Privacy

© 2025 Treehouse Island, Inc.