The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by srinivasum]

1. On page 316 of THE book what's the scope of System.Timers.Timer timer. I
guess the question is why is it not a private member variable? Thanks in
advance.
import-bot (20211) [Avatar] Offline
#2
Re: A Scope question (page 316 line 2, timer variable)
[Originally posted by fgrimes]

>> On page 316 of THE book what's the scope of
>> System.Timers.Timer timer. I guess the question
>> is why is it not a private member variable?
>> Thanks in advance.

It's just a regular local reference declared in the Clock constructor. You
could make it a private class member, if you wish - it certainly wouldn't
hurt. But, in this case, there is no need to hang onto a class-wide reference
to the timer. (That's my own rule of thumb.)

Regards,
Fergal