✨ 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
    • Add a Constant
    • Close
  • Benjamin Cha
    Benjamin Cha
    2,761 Points

    Adding MAX_BARS for Go Karts

    Posted on Mar 5, 2024 by Benjamin Cha
    Benjamin Cha
    2,761 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Add a Constant

    1 Answer

  • Fredrik Ljunggren
    Fredrik Ljunggren
    2,900 Points

    Need help

    Posted on Feb 1, 2022 by Fredrik Ljunggren
    Fredrik Ljunggren
    2,900 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Add a Constant

    1 Answer

  • Matthew Maslow
    Matthew Maslow
    454 Points

    constant variable

    Posted on Nov 22, 2021 by Matthew Maslow
    Matthew Maslow
    454 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Add a Constant

    1 Answer

  • Andrew Li
    Andrew Li
    4,251 Points

    I got a weird error message but cant figure out what I did wrong here.

    Posted on May 22, 2020 by Andrew Li
    Andrew Li
    4,251 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Add a Constant

    2 Answers

  • Josh Haefner
    Josh Haefner
    1,110 Points

    Java constant code challenge

    Posted on Aug 22, 2019 by Josh Haefner
    Josh Haefner
    1,110 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Add a Constant

    1 Answer

  • Joseph Saika
    Joseph Saika
    2,648 Points

    creating constants in a code

    Posted on Mar 9, 2019 by Joseph Saika
    Joseph Saika
    2,648 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Add a Constant

    4 Answers

  • Claus Jessing
    Claus Jessing
    1,674 Points

    What is the problem with line number 2?

    Posted on Oct 2, 2018 by Claus Jessing
    Claus Jessing
    1,674 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Add a Constant

    1 Answer

  • Ayhan Güler
    Ayhan Güler
    8,658 Points

    In my opinion the challenge says "accessable on class level", which means private or protected to me - not public?

    Posted on Jun 27, 2018 by Ayhan Güler
    Ayhan Güler
    8,658 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Add a Constant

    2 Answers

  • Tomasz Baranczuk
    Tomasz Baranczuk
    7,055 Points

    What is wrong with my code? I did exactly the same as on the movie. public static final MAX_BARS = 12;

    Posted on Feb 11, 2018 by Tomasz Baranczuk
    Tomasz Baranczuk
    7,055 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Add a Constant

    2 Answers

  • Laurence Cimosz
    Laurence Cimosz
    8,993 Points

    "max bars

    Posted on Feb 8, 2018 by Laurence Cimosz
    Laurence Cimosz
    8,993 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Add a Constant

    1 Answer

  • Andrei Punei
    Andrei Punei
    14,051 Points

    its not working

    Posted on Jan 25, 2018 by Andrei Punei
    Andrei Punei
    14,051 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Add a Constant

    2 Answers

  • Francis Lamy
    Francis Lamy
    8,218 Points

    Make sure that you've marked the MAX_BARS field with the static keyword. Which static keyword?

    Posted on Jun 25, 2017 by Francis Lamy
    Francis Lamy
    8,218 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Add a Constant

    2 Answers

  • swm r
    swm r
    457 Points

    whats wrong here?

    Posted on Jun 7, 2017 by swm r
    swm r
    457 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Add a Constant

    1 Answer

  • Schwartz Prince
    PLUS
    Schwartz Prince
    Courses Plus Student 2,132 Points

    Where I went wrong?

    Posted on Feb 23, 2017 by Schwartz Prince
    Schwartz Prince
    Courses Plus Student 2,132 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Add a Constant

    1 Answer

  • Vamshi Raj Manchala
    Vamshi Raj Manchala
    848 Points

    Aren't the variable names in Java start with lower case letters?

    Posted on Jan 27, 2017 by Vamshi Raj Manchala
    Vamshi Raj Manchala
    848 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Add a Constant

    1 Answer

  • Jiho Song
    Jiho Song
    16,469 Points

    HOW SHOULD I DO? (JAVA)

    Posted on Dec 28, 2016 by Jiho Song
    Jiho Song
    16,469 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Add a Constant

    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.