Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Henrik Christensen
Henrik Christensen
Python Web Development Techdegree Student 38,322 Points

IntelliJ IDEA


I'm currently using IntelliJ IDEA for Java development and really love it, but I've noticed that it keeps telling me some methods and/or classes and be set to private instead of public even though they are used in other classes/files, and if I try set them to private then the program won't run.

Any idea why it's doing this?

1 Answer

Seth Kroger
Seth Kroger
56,409 Points

For me this usually happens because the methods aren't called directly, but are used/auto-wired through annotations. Is that the case? You can disable the suggestion by right clicking the light bulb and choose to disable the inspection entirely or just for the annotation the method has.