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! While you're at it, check out some resources Treehouse students have shared here.

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

Java Java Objects (Retired) Harnessing the Power of Objects Methods and Constants

please help me with static keyword!

i try to understand what do we need to use the static keyword but i really don't get it.. can somebody explain me please?

2 Answers

static ===> show variable or method belongs to the class. you can call static variable or method with class's its name. You cannot call it with object's name. When object is created( Class object = new Class() ), static variables and methods do not copied to the object. All objects of that class will share static variables or methods.

thanks! :)