why a class contains main method has to made public

sakthi.abdullah's Avatar, Join Date: Mar 2007
Go4Expert Member
Hi
Why a class containing main method has to made public..?
pradeep's Avatar, Join Date: Apr 2005
Team Leader
public indicates that the main method can be called by any object.
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
I am not a Java expert that reason could be for having the main public but for having the class public the reason could be it can be invoked from any package.