Subject: Overloading Overriding
Posted By: arv1980 Post Date: 1/15/2006 11:22:38 AM
Hi There,

I downloaded a code from net. I analysed the code.

<a href="http://www.only4gurus.com/v3/download.asp?resource=3281" rel="nofollow">http://www.only4gurus.com/v3/download.asp?resource=3281</a>[<a href="http://www.only4gurus.com/v3/download.asp?resource=3281" target="_blank" rel="nofollow" title="New Window">^</a>]

The file is <i>ScopingOverloadingOverriding.zip</i>
But it doesn't works the way I thought. I belive it should give a error when Employees Salary as every employee sal should be in a particular range like for full time employee the range should be between 30000 & 50000. But it doesn't happens. Can anyone please tell me that am I correct will it show error. If not then what is the effect of line

<b>if value<30000 and value >50000 then
throw new argumentoutofrangeexception ("Salary", Full Time salary should be between 30000 and 500000")</b>

How should one diagnose the code that is given in a class file. Usually F10 mode is used but it skips code given in class file and directly returns answer to the actual code. I want to check each line of the class file.

Please Help.

Thanking you and waiting for some kind replies.

Amit

Reply By: Imar Reply Date: 1/15/2006 2:10:49 PM
You need to use Or instead of And. A number cannot be less than 30000 and larger than 50000 at the same time, so the code in the If statement will never fire.

Using F11 takes you into a function call, instead of stepping over it.

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply By: arv1980 Reply Date: 1/21/2006 11:55:45 PM
Hey Thanks Imar... Thanks a lot. I will Try it.


Go to topic 37512

Return to index page 389
Return to index page 388
Return to index page 387
Return to index page 386
Return to index page 385
Return to index page 384
Return to index page 383
Return to index page 382
Return to index page 381
Return to index page 380