What is the use of "default" and "Using" keyword?

Answers were Sorted based on User's Feedback



What is the use of "default" and "Using" keyword?..

Answer / pavan kumar

"default" is a keyword which can be used in two ways
1)In switch as default label
2)In generics as default paramenter.

same as "using" key word this also used in two ways
1)For implementing the namespace into current class
2)Used to check properly dispose of object using the
IDisposable interface

Is This Answer Correct ?    9 Yes 0 No

What is the use of "default" and "Using" keyword?..

Answer / ravi

"default" ensures the correct initialisation takes place
and "Using" ensures the disposal of object.

Is This Answer Correct ?    6 Yes 2 No

What is the use of "default" and "Using" keyword?..

Answer / kamil

If expression does not match any constant-expression, control is transferred to
the statement(s) that follow the optional default label. If there is no default
label, control is transferred outside the switch.

Is This Answer Correct ?    3 Yes 3 No

Post New Answer

More C Sharp Interview Questions

What are sorted lists?

0 Answers  


Why do you call it a process? What’s different between process and application in .net, not common computer usage, terminology?

0 Answers  


how do you do exception management

4 Answers   Accenture, HCL,


Can a class be protected in c#?

0 Answers  


What is application object in c#?

0 Answers  






Can an Assembly have multiple versions

13 Answers   TCS,


What is namespace explain with example?

0 Answers  


Why do we need delegates?

0 Answers  


What is the difference between int16 and int32 in c#?

0 Answers  


int a = '3' + '4'; char n = (char)a; What will be answer of n?

4 Answers  


What is Dispose method in .NET?

3 Answers  


How to update the gui from another thread in c#?

0 Answers  


Categories