by 
[Help |
API Docs |
Short Course|
Exercises]
For this exercise you will create and initialize an array of integers and an array of String objects.
[If you are using IBM's VisualAge for Java for this exercise,
then use the scrapbook to type and test your code (without a
main method etc...), thus, avoiding the need to fill in the
skeleton code, compile, and run from the command line.].
Prerequisites
Skeleton Code
Tasks
Make an array of 5 integers.
Use a for loop to set the values
of the array to the index plus 10.
Use a for loop to print out the values in the array.
Make an array of strings initialized to Frank, Bob, and Jim using the variable initializer syntax.
Use a for loop to print out the strings
in the array.
Set the last element of the array to Mike.
Print out the last element in the array.
Where help exists, the task numbers above are linked to the step-by-step help page.
Solution Source
Demonstration
If you execute Arrays from a command line, the output should be similar to the following:
10
11
12
13
14
Frank
Bob
Jim
Mike
|
Copyright 1996-2000 jGuru.com. All Rights Reserved.
|