Skip to main content

NOTICE: On Friday Nov 6, Workspaces will be temporarily unavailable for maintenance.

🚀 In our NEW AI Bootcamp you'll build a working app in 28 days, no experience required. Free to all subscription levels.

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

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

  • Treehouse Logo
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
    • All Courses
    • Tracks
    • AI Bootcamp
    • College Credit
    • Techdegree Bootcamps
    • Front End Development
    • Full Stack JavaScript
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
    • Explore
    • Career Toolbox
    • Free Treehouse Near Me
    • Affiliates
    • Blog
    • Support
    • About
    • Learn
    • Beginner's Guide to Coding
    • Data Analysis with SQL & Python
    • Front-End Web Development
    • Python Programming Basics
    • Techdegree Bootcamp Overview
    • UX Design Fundamentals
    • AI Tools for Beginners
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks AI Bootcamp College Credit
  • Techdegree Bootcamps Front End Web Development Full Stack JavaScript
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Explore Career Toolbox Free Treehouse Near Me Affiliates Blog Support About
    Learn Beginner's Guide to Coding Data Analysis with SQL & Python Front-End Web Development Python Programming Basics Techdegree Bootcamp Overview UX Design Fundamentals AI Tools for Beginners
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
Loading banner... Start your free trial at Treehouse
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • 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
      • • Vibe Coding
  • 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.

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
SEE ALL

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
SEE ALL

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
SEE ALL

About Us

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

Explore

  • Plans
  • Affiliates
  • Perks
  • Shop
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses

Treehouse is an online technology education platform founded in 2011. Treehouse offers more than 700 self-paced, video-based courses in web development, programming, data analysis, design, and AI, plus two project-based bootcamp programs in Front End Web Development and Full Stack JavaScript. Individual Treehouse plans start at $25 per month and include a 7-day free trial. Treehouse serves individual learners, businesses, schools, and public libraries. Cardholders at participating U.S. public libraries can use Treehouse for free. Select Treehouse courses, offered with University Pathways International, are recommended for college credit by ACE and NCCRS. Treehouse learners earn digital certificates for completed Tracks.

Terms & Conditions · Privacy · © 2026 Treehouse Island, Inc.
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
  • Discord