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 |
What is a static class in c#?
Explain metadata in c#.
what is bubbled event ? give suitable example in code vice with demo
What is the .NET collection class that allows an element to be accessed using a unique key?
What does public mean in c#?
Can dictionary have duplicate keys c#?
What is difference between ienumerable and list in c#?
what are ways to debug the code step by step except using breakpoints?
Can you inherit multiple classes in c#?
What does private void mean in c#?
This is Kishore i am MCA graduate i have percentage less(52%) in my 10th still i completed .NET course any body tell me how to put fake experience with my BSC degree if you do not mind tell me some fake certificates giving consultencies names in Chennai,Bangalore
What is the difference between disposing of () and finalize() methods in c#?