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 |
public void A() { int x; x = 8; x *= 4 + 8 / 2; } Given the above code, what is the value of "x"?
how to use msflexgrid in asp.net
What are the advantages of using assemble language programming?
Which types of inheritances does c# support?
Distinguish between a class and struct?
What connections does Microsoft SQL Server support?
Why do we use static class in c#?
What are the access modifiers in c#?
Where do we use static class in c#?
Explain the difference between .net and c#?
What is eager and lazy loading in c#?
Can we create extension method for interface?