Discussion Board
Go to the previous messageGo to the following message
Current Forum: Homework 3 Forum
Date: Sun Sep 30 2001 12:41 am
Author: Fagan, Matthew T. <mfagan@andrew.cmu.edu>
Subject: Re: Casting int to Object

I've been trying to add an int into my linenum Vector. Every time I try to add an int in, it gives me an error:

public void Insert(String word, int location)
{...
linenum.add(location);
...}
where linenum is a Vector, I get the following error:
TrieNode.java: Incompatible type for method. Can't convert int to Java.lang.Object.
linenum.add(location)
^

What's going on here?
Post response

Go to the previous messageGo to the following message
Current Thread Detail:
Casting int to Object      Zaman, Rashid      Fri Sep 28 2001 7:44 pm       
Re: Casting int to Object      Lee, Charles C.      Fri Sep 28 2001 10:49 pm       
Re: Casting int to Object      Fagan, Matthew T.      Sun Sep 30 2001 12:41 am       
Re: Casting int to Object      Liu, Limin Angela      Sun Sep 30 2001 3:08 am       

Back to previous screen