|
-
Feb 19th, 2001, 12:40 PM
#4
hold[i] is an int
hold is an int array
hold is an Object
hold[i] is a primitive
Depending on what you are trying to accomplish, you can add the entire array (since it's an Object) in one call
vec.addElement(hold);
i am casting an integer array to a integer object class?
No.
That casts an int (not an int array) to an Integer object.
Because all objects inherit from Object, you can use the Integer object in the addElement method.
I am using the term object and Object as a general term and a type name respectively.
You are welcome 
Note: Technically, I shouldn't say "casts an int to an Integer", it's more like "wraps an int, making an Integer object".
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|