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
  • Michel Spaniolo
    PLUS
    Michel Spaniolo
    Courses Plus Student 1,850 Points

    im getting errors that say semicolons are missing but theyre there.

    Posted May 22, 2022 11:30pm by Michel Spaniolo
    Michel Spaniolo
    Courses Plus Student 1,850 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    3 Answers

  • Filip Glinz
    Filip Glinz
    471 Points

    Could not find or load main class Example (or new created class) why?

    Posted August 17, 2020 6:12pm by Filip Glinz
    Filip Glinz
    471 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    1 Answer

  • Alexander Price
    Alexander Price
    422 Points

    I get the error saying that in my line 7 of Example.java, it cannot find the variable PezDispenser.MAX_PEZ);

    Posted July 25, 2020 6:55pm by Alexander Price
    Alexander Price
    422 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    0 Answers

  • Kortney Field
    Kortney Field
    14,091 Points

    how to reset the workspaces

    Posted December 4, 2019 2:07pm by Kortney Field
    Kortney Field
    14,091 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    1 Answer

  • Adam Stenning
    Adam Stenning
    7,132 Points

    "Undeclared but Uninitialized".

    Posted November 30, 2019 10:43am by Adam Stenning
    Adam Stenning
    7,132 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    1 Answer

  • abdelbasset sadok
    abdelbasset sadok
    1,304 Points

    why you use the same class name at the method name and why you use the same variable name twice :/ ????

    Posted November 12, 2019 4:00pm by abdelbasset sadok
    abdelbasset sadok
    1,304 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    0 Answers

  • Chris Yan
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Chris Yan
    Full Stack JavaScript Techdegree Student 9,250 Points

    Should we change 'characterName' to 'CHARACTER_NAME' after changing it to a constant?

    Posted October 8, 2019 10:44pm by Chris Yan
    .a{fill-rule:evenodd;}techdegree
    Chris Yan
    Full Stack JavaScript Techdegree Student 9,250 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    1 Answer

  • Duy Nguyen
    Duy Nguyen
    583 Points

    Why do we not want to return pez count and use void

    Posted June 2, 2019 10:54pm by Duy Nguyen
    Duy Nguyen
    583 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    1 Answer

  • love maho
    love maho
    44 Points

    Please help

    Posted February 27, 2019 12:37am by love maho
    love maho
    44 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    1 Answer

  • Rana P
    Rana P
    885 Points

    Private or final? When to use where?

    Posted February 10, 2019 3:08pm by Rana P
    Rana P
    885 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    1 Answer

  • rehan guddu
    PLUS
    rehan guddu
    Courses Plus Student 122 Points

    Fill method

    Posted January 7, 2019 1:50pm by rehan guddu
    rehan guddu
    Courses Plus Student 122 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    2 Answers

  • rehan guddu
    PLUS
    rehan guddu
    Courses Plus Student 122 Points

    pezCount

    Posted January 7, 2019 1:12pm by rehan guddu
    rehan guddu
    Courses Plus Student 122 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    2 Answers

  • kevin salinas
    kevin salinas
    2,392 Points

    what do you return in each method? how do you know what to return??

    Posted September 9, 2018 3:16pm by kevin salinas
    kevin salinas
    2,392 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    1 Answer

  • oussama zeglama
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    oussama zeglama
    Full Stack JavaScript Techdegree Student 191 Points

    What's the %d here stand for ?

    Posted July 12, 2018 12:23am by oussama zeglama
    .a{fill-rule:evenodd;}techdegree
    oussama zeglama
    Full Stack JavaScript Techdegree Student 191 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    1 Answer

  • Michael Stewart
    Michael Stewart
    1,179 Points

    Does the main method have to be static?

    Posted March 27, 2018 5:11am by Michael Stewart
    Michael Stewart
    1,179 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    1 Answer

  • Andrew Fitzpatrick
    Andrew Fitzpatrick
    3,013 Points

    My output is not the same

    Posted March 17, 2018 5:15pm by Andrew Fitzpatrick
    Andrew Fitzpatrick
    3,013 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    1 Answer

  • Sarmishta Chaitanya
    Sarmishta Chaitanya
    2,204 Points

    Need clarification - Encapsulation and Abstraction

    Posted February 11, 2018 9:50am by Sarmishta Chaitanya
    Sarmishta Chaitanya
    2,204 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    2 Answers

  • Stephen Crispini
    PLUS
    Stephen Crispini
    Courses Plus Student 619 Points

    Why make MAX_PEZ public, but characterName private?

    Posted December 30, 2017 2:52am by Stephen Crispini
    Stephen Crispini
    Courses Plus Student 619 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    3 Answers

  • benjamin wong
    benjamin wong
    498 Points

    cannot find symbol for PezDispenser and MAX_PEZ from PezDispenser.java to Example.java

    Posted November 22, 2017 7:37am by benjamin wong
    benjamin wong
    498 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    1 Answer

  • James Stride
    PLUS
    James Stride
    Courses Plus Student 621 Points

    not-static variable MAX_PEZ cannot be referenced from a static context PezDispenser.MAX_PEZ);

    Posted October 16, 2017 11:28pm by James Stride
    James Stride
    Courses Plus Student 621 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    2 Answers

  • Arturs Certuks
    Arturs Certuks
    13,059 Points

    Could not find or load main class Example. - Can someone help with this, please???

    Posted August 9, 2017 8:56pm by Arturs Certuks
    Arturs Certuks
    13,059 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    0 Answers

  • Dylan McGee
    Dylan McGee
    1,610 Points

    Parameters

    Posted July 29, 2017 11:31am by Dylan McGee
    Dylan McGee
    1,610 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    1 Answer

  • Khanh Dao
    Khanh Dao
    641 Points

    Can anyone explain to me what is a object and a instance?

    Posted July 20, 2017 4:47pm by Khanh Dao
    Khanh Dao
    641 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    1 Answer

  • Florentin Dumitrache
    Florentin Dumitrache
    3,757 Points

    private vs public final

    Posted July 18, 2017 1:30pm by Florentin Dumitrache
    Florentin Dumitrache
    3,757 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    1 Answer

  • Price Rebel
    Price Rebel
    306 Points

    Why is dispenser.fill() not in the collumn?

    Posted July 17, 2017 8:11pm by Price Rebel
    Price Rebel
    306 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    1 Answer

  • Kenneth Emmanuel Kouadio Ziguy
    PLUS
    Kenneth Emmanuel Kouadio Ziguy
    Courses Plus Student 1,125 Points

    Still a bit confused about how objects and class work in code!

    Posted July 8, 2017 1:46pm by Kenneth Emmanuel Kouadio Ziguy
    Kenneth Emmanuel Kouadio Ziguy
    Courses Plus Student 1,125 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    1 Answer

  • Jacob Powell
    Jacob Powell
    577 Points

    Error

    Posted July 7, 2017 4:08pm by Jacob Powell
    Jacob Powell
    577 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    2 Answers

  • Tomas Svojanovsky
    Tomas Svojanovsky
    26,680 Points

    Why set a value in constructor?

    Posted April 29, 2017 9:36am by Tomas Svojanovsky
    Tomas Svojanovsky
    26,680 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    1 Answer

  • Jenise Moody
    PLUS
    Jenise Moody
    Courses Plus Student 1,985 Points

    Need help with "actual and formal arguments lists differ in length".

    Posted March 31, 2017 2:06pm by Jenise Moody
    Jenise Moody
    Courses Plus Student 1,985 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    1 Answer

  • Aryaman Kunzru
    Aryaman Kunzru
    928 Points

    when dispenser.fill is typed what does that do?

    Posted January 31, 2017 3:26am by Aryaman Kunzru
    Aryaman Kunzru
    928 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Filling the Dispenser

    1 Answer

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