lUnlike C++,
•stand alone programs must have at least one class
•it must have the same name as the file and
•within that class must be a method called main!
•public static void
main(String[] args)
lThe public keyword means that the member function (method) is available to the outside world
lThe static keyword means that this is a static member function which does not need a object of its class inorder to be
invoked
lThe argument is required (whether or not it is used) which holds the command line arguments.
lIn C++ the command
line arguments are optional as part of main
•int main (int argc, char * argv[]);
•Where argv is a “ragged array” in C and C++ (an array of arrays of
characters)
•In Java args is an array of string object references