AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

"Vector" che cambia da solo...

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java (Italian)
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Tue Nov 23, 2004 4:40 pm    Post subject: "Vector" che cambia da solo... Reply with quote



ho un oggetto Vector tipo "x = new Vector (1)" all'interno di un thread che
ha un unica chiamata start (quindi dovrebbe essercene solo uno alla volta in
esecuzione).
Dentro un ciclo ho varie chiamate "System.out.println (x.elementAt(0))" e
"System.out.println (x.elementAt(1))" così da visualizzare i due elementi
presenti, diciamo "a" e "b": a un certo punto all'improvviso diventano "b" e
"b". Ovviamente non è un fatto voluto. Non succede sempre dopo lo stesso
numero di "println". Cosa può essere? L'unica cosa che mi è venuta in mente
è un problema legato al fatto che la classe sia utilizzata come thread.
Idee?

Grazie.







Back to top
Vjger
Guest





PostPosted: Wed Nov 24, 2004 11:44 am    Post subject: Re: "Vector" che cambia da solo... Reply with quote



<@> wrote

Quote:
ho un oggetto Vector tipo "x = new Vector (1)" all'interno di un thread che
ha un unica chiamata start (quindi dovrebbe essercene solo uno alla volta in
esecuzione).
Dentro un ciclo ho varie chiamate "System.out.println (x.elementAt(0))" e
"System.out.println (x.elementAt(1))" così da visualizzare i due elementi
presenti, diciamo "a" e "b": a un certo punto all'improvviso diventano "b" e
"b". Ovviamente non è un fatto voluto. Non succede sempre dopo lo stesso
numero di "println". Cosa può essere? L'unica cosa che mi è venuta in mente
è un problema legato al fatto che la classe sia utilizzata come thread.
Idee?

Grazie.



Meglio se posti il codice...


Ciao

Back to top
Guest






PostPosted: Fri Nov 26, 2004 10:09 am    Post subject: Re: "Vector" che cambia da solo... Reply with quote



Grazie, risolto.







Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.