Results 1 to 4 of 4
- 03-09-2010, 12:04 PM #1
Member
- Join Date
- Jan 2010
- Posts
- 1
- Rep Power
- 0
Comparsion between Integer and Int
Hi,
currently making a game whereby i am using Vectors. i tried to make a comparsion between two types Integer and Int.
e.g
if(CPchosen.elementAt(i) == Id)
CPchosen is my vector and Id is initialzed as a int. However when i build this setting i get this error,
operator == cannot be applied to java.lang.Object,int
if(CPchosen.elementAt(i) == Id)
I understand that its becos i am trying to make comparsion between 2 diferent types. So I tried to initialize my vector to become an int
Vector<int>CPchosen = new Vector<int>();
But by doing so, i get the following error.
generics are not supported in -source 1.3
(use -source 5 or higher to enable generics)
Hence i seek help in resolving this issue, anyone can help?
- 03-09-2010, 12:31 PM #2
Cast CPchosen.elementAt(i) to Integer
Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
The Ubiquitous Newbie Tips
- 04-15-2010, 07:38 PM #3
Member
- Join Date
- Apr 2010
- Posts
- 3
- Rep Power
- 0
generics are not supported in -source 1.3
(use -source 5 or higher to enable generics)It's why it shows errors because u r using generics - Vector<T> - which is not available in Java 1.3.Vector<int>CPchosen = new Vector<int>();Last edited by Pixio; 04-15-2010 at 07:43 PM.
- 04-15-2010, 10:15 PM #4
Senior Member
- Join Date
- Mar 2010
- Posts
- 953
- Rep Power
- 4
Similar Threads
-
1 as an integer, not boolean
By McChill in forum New To JavaReplies: 1Last Post: 05-02-2009, 09:39 PM -
integer with leading zero?!
By tomiu in forum New To JavaReplies: 4Last Post: 04-22-2009, 09:42 PM -
.java files comparsion
By rhub in forum EclipseReplies: 4Last Post: 09-22-2008, 02:55 PM -
VeryLong Integer.. help
By hey in forum New To JavaReplies: 4Last Post: 12-14-2007, 09:48 PM -
Integer vs int
By bugger in forum New To JavaReplies: 1Last Post: 11-14-2007, 09:13 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks