• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

parameter in threads

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.
I don't know how put a parameter for something like this:

Pseudo-code:


this its possible??

Anybody knows another way to do this???

Thanks in advance...
 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What you do want? Do you want to pass an integer to a method? Yes that is possible :P
 
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Mario Gimenez
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is the project how send one message.



Now I want to use this to send many messages (whit threads or another ways....),
Because I need change a part of the message in each call I need pass a string parameter via Thread.
Because I need to know if its possible pass a String parameter to a thread.

for example...

>>Main..
for (x= 0; x< 50; x++){
Thread t = new Thread(x);
t.start();

}

>>run
MyClass mc = new MYclass();

mc.sendMessage(x); ----> this method it will replace the main method in the code I wrote before.



I hope I describe my doubt.




Thanks a lot.
 
Sheriff
Posts: 22665
127
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is reading really that hard? Ireneusz has just about given you the complete answer, over 12 hours before your post.
 
reply
    Bookmark Topic Watch Topic
  • New Topic