What data type should be used when we want to store any type of data?
All predefined and user-defined types inherit from the object type.
What is an Immutable variable?
- An object whose value cannot be changed once it is set.
- type An object whose value can be changed once it is set.
It is the object whose value cannot be modified once the value is assigned.
Example String Variable.
Which Exception is thrown when a variable on RHS is casted to and is not as of type on LHS?
- Invalid cast Exception
- Argument Null Exception
- Application Exception
- System Exception
The InvalidCastException occurs when an explicit cast is applied to a type that is not in the same path of the type hierarchy.
What is the default value of the first enum member?
The default value for an enum is 0 -- even if that is not a valid value for that enum. It cannot be changed.
_______ is the term used to describe the transformation from Value Type to reference type.
- Implicit Casting
- Explicit Casting
Boxing refers to the conversion of Value type to an Object (Reference type).
Unboxing means conversion of Object to Value type.
static void Main(string[ ] args)
int n; char chr;
chr = (char)(65);
chr = 'a';
n = (int)(chr);
As per ASCII Code A=65 to Z= 90 and a=97 to z=122 here casting is done.
Can a decimal be categorized as floating point datatype?
The decimal allows digits after decimal point, the number of digits are fixed unlike float where number of digits are not fixed.
What is the type of a Structure?
Value types directly holds the value from the stack memory
What are the operators supported in C# not in VB.Net?
- ++, --
- ? :, <<, >>
- ==, sizeof
- All the above
Sorry, there is no explanation for this question
How to iterate loop infinitely?
- set condition (true)
- set condition (false)
Ex: set condition (true) that does not change,
//Code block here...