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

Arjun Vemperala
1,212 Pointscan any one explain the importance of static void in this code public static void main(String[] args){ }
can any one explain the importance of static void in this code public static void main(String[] args){ } code taken from creating classes in java objects
1 Answer

Simon Coates
28,693 Pointspublic static void main(String[] args) is typically how you run a Java program. (there are similarly named methods in other c-family languages). The essential information is that java and IDE's know to look for this method (with that precise name/signature). To break it down further, it's public - hence is accessible. It's static - hence doesn't require any existing object to run. And it has a String[] parameter to accept arguments from the command line. And void means it doesn't need to return any value.