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
  • Benjamin Cha
    Benjamin Cha
    4,095 Points

    Adding MAX_BARS for Go Karts

    Posted March 5, 2024 12:50am by Benjamin Cha
    Benjamin Cha
    4,095 Points
    • Java
    • Java Objects
    • Harnessing the Power of Objects
    • Add a Constant

    1 Answer

  • Fredrik Ljunggren
    Fredrik Ljunggren
    2,900 Points

    Need help

    Posted February 1, 2022 8:00pm 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 November 22, 2021 3:58pm 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 May 22, 2020 11:15am 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 August 22, 2019 2:55am 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 March 9, 2019 11:37am 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 October 2, 2018 8:42am 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 June 27, 2018 1:18pm 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 February 11, 2018 1:50am 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 February 8, 2018 10:38pm 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 January 25, 2018 9:28am 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 June 25, 2017 12:54pm 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 June 7, 2017 9:12pm 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 February 23, 2017 9:34pm 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 January 27, 2017 1:48pm 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 December 28, 2016 3:56am 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.

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