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

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

New No-Code Track! 🚀start learning today!

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

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

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

  • 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
    • 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
  • 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
    • Showing results for:
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Method Overloading
    • Close
  • Christina Vieau
    Christina Vieau
    679 Points

    Error when trying to compile PezDispenser

    Posted on Dec 3, 2023 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 on May 24, 2022 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 on Nov 24, 2020 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 on Apr 11, 2020 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 on Jan 20, 2019 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 on Nov 17, 2018 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 on Nov 5, 2018 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 on Sep 30, 2018 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 on Sep 19, 2018 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 on Jul 5, 2018 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 on Jun 14, 2018 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 on Apr 6, 2018 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 on Mar 10, 2018 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 on Dec 26, 2017 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 on Nov 28, 2017 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 on Nov 6, 2017 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 on Oct 7, 2017 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 on Aug 10, 2017 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 on Aug 3, 2017 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 on May 18, 2017 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 on Apr 18, 2017 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 on Dec 29, 2016 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.