Send Close Add comments: (status displays here)
Got it!  This site uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.nbsp; Note: This appears on each machine/browser from which this site is accessed.
Lists


1. Lists

2. Lists
A list is a sequence of elements or items that can be indexed by (whole number) position or in sequence from beginning to end.

All elements or items need not be the same type - for dynamically typed languages.

For statically typed languages, the types must be the same, unless special precautions (or tricks) are used.

Many programming languages provide a way to hard-code a list within a program.

Some of these ways are now presented along with a way to output the list from beginning to end.

3. Static lists
Below are some examples of static or literal lists.

4. Java code
Here is the Java code.


5. Java output
Here is the output of the Java code.


6. End of page