Problems with static methods
Having problems with these two methods:
publicclass Skills{
/** Other code here */
publicstatic Hashtable makeSkills(){
/** code adding 69 elements to a HashTable */
}
/** more irrelevant stuff here too */
}
private String[] skillsModel(){
String[] a =new String[70];
int i =0;
Enumeration e = (Skills.makeSkills()).keys();
while(!e.hasMoreElements()){
a[i]= (String)e.nextElement();
}
}
Any ideas?
[1071 byte] By [
wihatcha] at [2007-11-27 10:51:40]

Changewhile(!e.hasMoreElements()){
towhile(e.hasMoreElements()){
And add an i++ as the last statement in the while loop.
And in the future, try to be more clear in your posts. People around here generally don't want to guess at what your problem is.
dwga at 2007-7-29 11:32:50 >

Oh wait, forgot to post the problem. I knew I forgot something....
edit: How do I edit the OP? Problem with it is I get this error:
symbol : method makeSkills()
location: class javax.swing.JComboBox
Enumeration e = (Skills.makeSkills()).keys();
Message was edited by:
wihatch
> Oh wait, forgot to post the problem. I knew I forgot
> something....
>
> edit: How do I edit the OP?
You can't once it's been replied to.
> Problem with it is I get
> this error:
>
> symbol : method makeSkills()
> location: class javax.swing.JComboBox
> Enumeration e =
> (Skills.makeSkills()).keys();
That's not the entire error is it?
That would imply that the class Skills has no method named makeSkills, are you sure their spelled the same (remember case matters)?
dwga at 2007-7-29 11:32:50 >

Note: C:\Documents and Settings\William Hatch\ShadowRun\src\Skills.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
BUILD FAILED (total time: 0 seconds)
That's the rest of it. Both classes are in the same folder. It's annoying me to tears.
Are you compiling on the command line?
If so, is your classpath correct?
Is this what you dojavac -classpath . ClassName.java
?
dwga at 2007-7-29 11:32:50 >
