- #1
the_kool_guy
- 37
- 0
casting in java...&& wrapper class
well my question is quite simple.
1..) when a vector is instantiated ,does it needs to have a particular data type like integer,employee... like in case of array or does any object can be put into it irrespective of its name...
example.
Vector employee = new Vector(50,20);
can i store a reference to integer by wrapping it in this vector
2..) when a Integer class is stored in vector,how can i get the int value stored in it.
a.. just by accessing the index where a wrapper class is stored .. or..
b.. storing the accessed reference in some variable and then applying Intvalue method..?
second question pls clarify w.r.t every other primitive wrapper class...
thanks
Homework Statement
well my question is quite simple.
1..) when a vector is instantiated ,does it needs to have a particular data type like integer,employee... like in case of array or does any object can be put into it irrespective of its name...
example.
Vector employee = new Vector(50,20);
can i store a reference to integer by wrapping it in this vector
2..) when a Integer class is stored in vector,how can i get the int value stored in it.
a.. just by accessing the index where a wrapper class is stored .. or..
b.. storing the accessed reference in some variable and then applying Intvalue method..?
second question pls clarify w.r.t every other primitive wrapper class...
thanks