Use of Checked and UnChecked operators?
Answers were Sorted based on User's Feedback
Answer / jackir
when value of a datatype excided its limitaion then its
call overflow to avoid this problem we use ckecked and
unchecked
syntax
return unchecked(x+y);
return checked(x+y);
Is This Answer Correct ? | 9 Yes | 0 No |
Answer / hridya
In a checked context, if the operation is a constant
expression a compile-time error occurs. Otherwise, when the
operation is performed at run-time, a
System.OverflowException is thrown.
In an unchecked context, the result is truncated by
discarding any high-order bits that do not fit in the
destination type.
Is This Answer Correct ? | 4 Yes | 0 No |
Advantages of c# over vb.net?
Explain constructor.
what is the index value of the first element in an array?
Does c# provide copy constructor?
Why can?t you specify the accessibility modifier for methods inside the interface?
3 Answers Mind Tree, Siebel Systems,
What are lambda expressions used for?
Can we declare private class in c#?
How u make an application remotable?
How do partial classes work in c#?
What is or operator in c#?
What is an object pool in .net?
What is serialization in dot net?