| Author |
array question
|
Scott Pocane
Greenhorn
Joined: Nov 03, 2003
Posts: 2
|
|
|
ok if i want 3 different ellements in one array how would i go about doing that.
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24057
|
|
What do you mean by three different elements? Three different kinds of objects? You can use an Object array to hold any kind of objects, like Object[] myArray = { "A string", Color.RED, new Point(1, 2) }; But if you're going to count on a certain object being in a certain position (and I know that's what you're going to do!) then don't use an array -- define a new class to hold the objects as member variables.
|
[Jess in Action][AskingGoodQuestions]
|
 |
 |
|
|
subject: array question
|
|
|