✨ 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
      • • Vibe Coding
    • Showing results for:
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions
    • Close
  • Morgan D'Antoni
    Morgan D'Antoni
    1,183 Points

    What is iae.getMessage() and how does it work?

    Posted on Nov 19, 2021 by Morgan D'Antoni
    Morgan D'Antoni
    1,183 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    1 Answer

  • Jasper Kop
    Jasper Kop
    10,423 Points

    Why ar you using printf instead of println?

    Posted on Nov 10, 2020 by Jasper Kop
    Jasper Kop
    10,423 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    1 Answer

  • Antonio Foresta
    Antonio Foresta
    931 Points

    I'm not sure what the role of this method in this class is

    Posted on Apr 26, 2020 by Antonio Foresta
    Antonio Foresta
    931 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    2 Answers

  • Graham Hornecker
    Graham Hornecker
    10,849 Points

    PezDispenser.java:18: error: cannot find symbol

    Posted on Nov 7, 2019 by Graham Hornecker
    Graham Hornecker
    10,849 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    1 Answer

  • Dinu Comendant
    Dinu Comendant
    6,049 Points

    Question about the challenge

    Posted on Jan 23, 2019 by Dinu Comendant
    Dinu Comendant
    6,049 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    2 Answers

  • luis cantu
    luis cantu
    927 Points

    If I use System.Out.Println in the try and catch block the execution fails, Why has to use Println and then Printf ?

    Posted on Oct 18, 2018 by luis cantu
    luis cantu
    927 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    2 Answers

  • victor medina
    victor medina
    540 Points

    Example.java:34: error: cannot find symbol. need help were is the error.

    Posted on Jul 25, 2018 by victor medina
    victor medina
    540 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    1 Answer

  • Bob Allan
    Bob Allan
    10,900 Points

    Why do Example.java and PezDispenser.java run at the same time?

    Posted on May 20, 2018 by Bob Allan
    Bob Allan
    10,900 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    1 Answer

  • yeoyeon kim
    yeoyeon kim
    2,586 Points

    fill(int pezAmount) method

    Posted on Apr 14, 2018 by yeoyeon kim
    yeoyeon kim
    2,586 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    1 Answer

  • Mayur Lalwani
    Mayur Lalwani
    9,074 Points

    Error in Exception

    Posted on Mar 9, 2018 by Mayur Lalwani
    Mayur Lalwani
    9,074 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    1 Answer

  • Andre Kucharzyk
    Andre Kucharzyk
    4,479 Points

    what is "iae" in catch (IllegalArgumentException iae)?

    Posted on Feb 8, 2018 by Andre Kucharzyk
    Andre Kucharzyk
    4,479 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    5 Answers

  • Valentin Dugan
    Valentin Dugan
    3,467 Points

    Why there`s an error when Craig set parameters of fill (400). Is because MAX_PEZ set value of 12 ?

    Posted on Jan 23, 2018 by Valentin Dugan
    Valentin Dugan
    3,467 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    1 Answer

  • disheng wang
    disheng wang
    5,422 Points

    Exception vs System.exit(0)

    Posted on Oct 29, 2017 by disheng wang
    disheng wang
    5,422 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    1 Answer

  • Tobi Rydlewicz
    Tobi Rydlewicz
    855 Points

    Print ("Error was %s", iae.getMessage());

    Posted on Jul 26, 2017 by Tobi Rydlewicz
    Tobi Rydlewicz
    855 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    1 Answer

  • Siu KWAN Yuen
    PLUS
    Siu KWAN Yuen
    Courses Plus Student 2,898 Points

    workspace snapshot

    Posted on Jul 12, 2017 by Siu KWAN Yuen
    Siu KWAN Yuen
    Courses Plus Student 2,898 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    3 Answers

  • Sayan Karmakar
    Sayan Karmakar
    636 Points

    Example.java

    Posted on May 25, 2017 by Sayan Karmakar
    Sayan Karmakar
    636 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    0 Answers

  • Rafic Rifai
    Rafic Rifai
    488 Points

    I cant figure out what i am doing wrong in the last exercise!! please help

    Posted on May 21, 2017 by Rafic Rifai
    Rafic Rifai
    488 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    2 Answers

  • Wan Nor Adzahari Wan Tajuddin
    Wan Nor Adzahari Wan Tajuddin
    2,438 Points

    getMessage method ?

    Posted on May 17, 2017 by Wan Nor Adzahari Wan Tajuddin
    Wan Nor Adzahari Wan Tajuddin
    2,438 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    1 Answer

  • Jacob Leatherwood
    PLUS
    Jacob Leatherwood
    Courses Plus Student 467 Points

    there is no try errors...

    Posted on Apr 25, 2017 by Jacob Leatherwood
    Jacob Leatherwood
    Courses Plus Student 467 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    1 Answer

  • Laura Mckay
    Laura Mckay
    599 Points

    Can't get part of my code to run!

    Posted on Mar 17, 2017 by Laura Mckay
    Laura Mckay
    599 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    1 Answer

  • Hussein Darwish
    Hussein Darwish
    631 Points

    what's meant by bubbling?

    Posted on Mar 14, 2017 by Hussein Darwish
    Hussein Darwish
    631 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    1 Answer

  • Haisem Jemal
    Haisem Jemal
    631 Points

    Whats the point of exceptions?

    Posted on Feb 26, 2017 by Haisem Jemal
    Haisem Jemal
    631 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    2 Answers

  • Michael Dinkins
    Michael Dinkins
    9,483 Points

    i am having issues with one of my variables. Please help

    Posted on Feb 6, 2017 by Michael Dinkins
    Michael Dinkins
    9,483 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    1 Answer

  • Varun Singh
    Varun Singh
    1,905 Points

    What if i do not put "pezCount = newAmount " and instead if put " pezCount += pezAmount" ??

    Posted on Jan 27, 2017 by Varun Singh
    Varun Singh
    1,905 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    1 Answer

  • Daniel Meles
    Daniel Meles
    1,459 Points

    half my code won't run

    Posted on Jan 6, 2017 by Daniel Meles
    Daniel Meles
    1,459 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Exceptions

    1 Answer

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.