C# Question: static int amountopen = (0 - 500); ???

chuawenching

Regular
Joined
Jul 26, 2003
Messages
66
Hi there,

I had some questions. I was learning c# and i saw this code:

static int amountopen = (0 - 500);

Hmm.. wonder, does it means we are setting a scope from 0 to 500 for integer amountopen?

This is first time i seen.

Oh ya, another added question. How does virtual keyword comes in handy in c# programming? Any good samples and explanations on that please.

Thanks.

Regards,
Chua Wen Ching :p
 
Looks like you're setting an int to -500... 0-500 is just zero subtract 500... -500.

And a virtual class means a class that must only be inherited and cannot be used on its own. (example: a PrimaryColor class that you inherit RedColor, BlueColor and GreenColor from, but don't want PrimaryColor itself being used).
 
Oh thanks.

So actually amountopen = -500

so actually why can't the coder place -500 at the first place but (0-500)? There must be a reason right?

Oh so virtual is used for that. Thanks a lot. :)

Anyway do you know which tutorial in c# which i can learn good oop design? I hope that tutorials utilizes oop concept in a better way. Any help? Thanks :)

Regards,
Chua Wen Ching :p
 
Back
Top