- Feb 8, 2004
- 12,604
- 15
- 81
To declare a variable of a variable type? I dont know a better way to word it. For example declaring a variable like this (which dosent work it seems but maybe theres another way):
as opposed to:
Im just tinkering around with objects at the moment, ive found out that I can stuff an array full of different object types as long as it is an Object[]. When taking them out I can use the Object.getClass() to see what it actually is, pretty cool
Code:
anObject.getClass() variableName = anObject;
as opposed to:
Code:
String variableName = anObject;
Im just tinkering around with objects at the moment, ive found out that I can stuff an array full of different object types as long as it is an Object[]. When taking them out I can use the Object.getClass() to see what it actually is, pretty cool