| Author |
Assign flaot array object to ref of type Object
|
Shrikant Pandhare
Greenhorn
Joined: Jul 29, 2005
Posts: 15
|
|
What does this expression mean Object oa = new float[20];
|
 |
Alejandro Montenegro
Greenhorn
Joined: Jul 05, 2004
Posts: 29
|
|
|
You are initializing an array that contains 20 primitive values of float in the reference variable oa ...
|
 |
Shrikant Pandhare
Greenhorn
Joined: Jul 29, 2005
Posts: 15
|
|
|
But how can i use oa now... or how to access those float elements
|
 |
Marcelo Ortega
Ranch Hand
Joined: May 31, 2005
Posts: 519
|
|
You will need to cast the reference variable back to an array of primative float values as follows: float[] myArray = (float[]) oa; Cheers.
|
SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJD, SCEA/OCMJEA
Live life to an interface, not an implementation!
|
 |
 |
|
|
subject: Assign flaot array object to ref of type Object
|
|
|