• 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
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Excercise 9-2

 
Ranch Hand
Posts: 176
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to synchronize a block of code as detailed on page 738/739.

I cannot figure out how to access the String that I pass to my MyThreaddy method on lines 9,10 and 11 of the below code.

I wish to access the letters 'a','b' or 'c', depending on the thread on line 33/34.


I hope somebody can help me. Thank you :-)
 
author
Posts: 23959
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Glen Iris wrote:I am trying to synchronize a block of code as detailed on page 738/739.

I cannot figure out how to access the String that I pass to my MyThreaddy method on lines 9,10 and 11 of the below code.

I wish to access the letters 'a','b' or 'c', depending on the thread on line 33/34.


I hope somebody can help me. Thank you :-)




The second parameter to the constructor (in lines 9, 10, and 11) is for the name of the thread ... which you changed in line 13, 14,and 15.

Henry
 
Glen Iris
Ranch Hand
Posts: 176
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Henry.
 
reply
    Bookmark Topic Watch Topic
  • New Topic