I know vectors only work with objects like Integer and String objects...
so can i perform basic operations .. like comparing a String to a String vectior object or doing math calculations with Integer objects and normal ints? Well actualyl i know atleast the second doesnt work as ive tried it...So my question is if there is anyway to change an Integer object to a normal int data type??
The reason im using vectors is so that i can easily remove them but i also have to do simple math aditions and string comparisons with them..so maybe vectors arnt the way to go? I dont know...help me ! Thanx.
In the first case you just get the objects out and compare them using equal() or equalIgnoreCase(). For the Integer/int, that's what the API Javadocs are for.
(Hint: *Value() methods.)
A java Vector works with all objects. If you are using a Vector for a case where
I know vectors only work with objects like Integer and String objects
you don't know how many objects you will be storing, its ok. If you know the number
of objects you may as well use an object array.
For Integer objects use the intValue() method to get the int value...
im very dumb and new to java lol.. could i please see an example?
like i have an int x
and i want
where Vect is a vector of Integer Objects.
how do u modify this to make it work with intValue() method?
Thanks a lot.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center