| | |
Summary: March 23, 2008 ICS102: The course 1
Arrays 3/4
March 23, 2008 ICS102: The course 2
Outline
Arguments for the Method main
Methods That Return an Array
Partially Filled Arrays
Accessor Methods Need Not Simply Return Instance Variables
Privacy Leaks with Array Instance Variables
Example
March 23, 2008 ICS102: The course 3
- Arguments for the Method main ...
The heading for the main method of a program has a
parameter for an array of String
It is usually called args by convention
public static void main(String[] args)
Note that since args is a parameter, it could be replaced by
any other non-keyword identifier
If a Java program is run without giving an argument to
main, then a default empty array of strings is automatically
|