• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Logic where?

 
raja singh kumar
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont know how to explain my question. But let me try.

I tried out 2 programs. One is Waiter/Notifier and other is Producer/Consumer.

In the waiter/Notifier program the logic is written in the class which implements Runnable. i.e. Waiter and Notifier class(in Code 1)

In the producer/consumer example the logic is written in the class which does not implement Runnable ie CubbyHole(in Code 2). Now my question how do I remember where to write the logic. Can someone please help me

I know it is a weird question but still
Code 1:


Code 2:
 
Campbell Ritchie
Sheriff
Posts: 51341
86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know, but I do know that you shou‍ld never write == true or == false. Both are poor style and dangerously error‑prone.
 
Norm Radder
Bartender
Posts: 1526
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also it would help if there were comments in the code.  Where is the logic the post asks about?  I can't easily tell by looking at the code.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic