Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Computer Certification > MCTS > Timers(70-536)

Reply
Thread Tools

Timers(70-536)

 
 
blade
Guest
Posts: n/a
 
      02-23-2008
Hey,
This question is not clear for me.Does they mean that callback is never
invoked or only once?
What is correct ansewer?

You are developing a Windows Service application by using the .NET Framework
2.0. You write the following code in your class:
Dim myTimer As Timer = New Timer(statusDelegate, Nothing, 1000, 250)
The delegate statusDelegate is already correctly defined in your class. You
must modify the code so that the callback method is not invoked periodically.
Which code segment should you use?
A. Dim myTimer As Timer = _
New Timer(statusDelegate, Nothing, Timeout.Infinite, 0)
B. Dim myTimer As Timer = _
New Timer(statusDelegate, Nothing, 1000, Timeout.Infinite)
C. Dim myTimer As Timer = _
New Timer(statusDelegate, Nothing, 0, 32767)
D. Dim myTimer As Timer = _
New Timer(statusDelegate, Nothing, Timeout.Infinite, 250)

 
Reply With Quote
 
 
 
 
Michael D. Alligood [CertGuard, Inc.]
Guest
Posts: n/a
 
      02-23-2008
"blade" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed):

> Hey,
> This question is not clear for me.Does they mean that callback is never
> invoked or only once?
> What is correct ansewer?
>
> You are developing a Windows Service application by using the .NET Framework
> 2.0. You write the following code in your class:
> Dim myTimer As Timer = New Timer(statusDelegate, Nothing, 1000, 250)
> The delegate statusDelegate is already correctly defined in your class. You
> must modify the code so that the callback method is not invoked periodically.
> Which code segment should you use?
> A. Dim myTimer As Timer = _
> New Timer(statusDelegate, Nothing, Timeout.Infinite, 0)
> B. Dim myTimer As Timer = _
> New Timer(statusDelegate, Nothing, 1000, Timeout.Infinite)
> C. Dim myTimer As Timer = _
> New Timer(statusDelegate, Nothing, 0, 32767)
> D. Dim myTimer As Timer = _
> New Timer(statusDelegate, Nothing, Timeout.Infinite, 250)


Where are you getting this question?

--
Michael D. Alligood, MCITP, MCTS, MCSA, MCDST
The I.T. Classroom - http://www.theitclassroom.com/
CertGuard, Inc. - http://www.certguard.com/


 
Reply With Quote
 
 
 
 
Vijay Jagdale
Guest
Posts: n/a
 
      03-12-2008
Blade - I would interpret "periodically" to mean "over and over again", i.e.
repetitively. Not invoking it at all defeats the purpose of a Timer, so I
would go with "B". But I see your point, because "A" is technically correct
because in the strictest sense the timer will not periodically invoke - in
fact it does not invoke it at all.


"blade" wrote:

> Hey,
> This question is not clear for me.Does they mean that callback is never
> invoked or only once?
> What is correct ansewer?
>
> You are developing a Windows Service application by using the .NET Framework
> 2.0. You write the following code in your class:
> Dim myTimer As Timer = New Timer(statusDelegate, Nothing, 1000, 250)
> The delegate statusDelegate is already correctly defined in your class. You
> must modify the code so that the callback method is not invoked periodically.
> Which code segment should you use?
> A. Dim myTimer As Timer = _
> New Timer(statusDelegate, Nothing, Timeout.Infinite, 0)
> B. Dim myTimer As Timer = _
> New Timer(statusDelegate, Nothing, 1000, Timeout.Infinite)
> C. Dim myTimer As Timer = _
> New Timer(statusDelegate, Nothing, 0, 32767)
> D. Dim myTimer As Timer = _
> New Timer(statusDelegate, Nothing, Timeout.Infinite, 250)
>

 
Reply With Quote
 
xr280xr
Guest
Posts: n/a
 
      04-03-2008
I agree, my impression was that they want it to invoke once and only once.

"Vijay Jagdale" wrote:

> Blade - I would interpret "periodically" to mean "over and over again", i.e.
> repetitively. Not invoking it at all defeats the purpose of a Timer, so I
> would go with "B". But I see your point, because "A" is technically correct
> because in the strictest sense the timer will not periodically invoke - in
> fact it does not invoke it at all.
>
>
> "blade" wrote:
>
> > Hey,
> > This question is not clear for me.Does they mean that callback is never
> > invoked or only once?
> > What is correct ansewer?
> >
> > You are developing a Windows Service application by using the .NET Framework
> > 2.0. You write the following code in your class:
> > Dim myTimer As Timer = New Timer(statusDelegate, Nothing, 1000, 250)
> > The delegate statusDelegate is already correctly defined in your class. You
> > must modify the code so that the callback method is not invoked periodically.
> > Which code segment should you use?
> > A. Dim myTimer As Timer = _
> > New Timer(statusDelegate, Nothing, Timeout.Infinite, 0)
> > B. Dim myTimer As Timer = _
> > New Timer(statusDelegate, Nothing, 1000, Timeout.Infinite)
> > C. Dim myTimer As Timer = _
> > New Timer(statusDelegate, Nothing, 0, 32767)
> > D. Dim myTimer As Timer = _
> > New Timer(statusDelegate, Nothing, Timeout.Infinite, 250)
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments