Home
|
Tutorial
|
Articles
|
Forum
|
Interview Question
|
Code Snippets
|
News
|
Fun Zone
|
Poll
|
Web Links
|
Certification
|
Search
Welcome :
Guest
Sign In
Register
Win Surprise Gifts!!!
Congratulations!!!
Top 5 Contributors of the Month
satyapriyanayak
Narayanan
Thamilselvan J
Anna Harris
Eone James
Home
>>
Interview Question
>>
C#
>>
Post New Question
Subscribe to Interview Questions
What is use of C# "Default" Keyword?
Posted By :
Narayanan
Posted Date :
December 14, 2011
Points :
40
Category :
C#
Initialize default value for its type
You can also find related Interview Question to
What is use of C# "Default" Keyword?
below:
Where to use default keyword?
used in the Switch statement or generic code.
(More...)
The default way of passing arguments to a function is ?
VALUE
(More...)
A default property is called as a...
Indexer
(More...)
The c# keyword int maps to .net type?
system.int32
(More...)
What is the default access specifier for a top level class which are not nested into other class?
internal
(More...)
C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write?
The answer is TWO of the above questions
(More...)
What is Default value of Bool ?
0 is the defaault value of boolean in .NET
(More...)
Yield keyword in C Sharp
C Sharp and yield keyword
Hi,
One of the cool and yet most unknown feature of the C# is the yield keyword. The yield keyword is used in an iterator block to provide a value to the enumerator object or to signal the end of the iteration. When used the expression is evaluated and returned as a value to the enumerator object. Note the expression has to be implicitebly convertible to yield type of the iterator. Here is an example
public static IEnumerable
GetIntCollectionFromString(string SomeString){ string[] val = SomeString.Split(' '); int intToAdd; foreach (string token in val) { if (int.TryParse(token, out intVal)) { yield return intVal; } else { yield break; } }}
Here since we are using the yield keyword the function will return the collection of intVal instead of the value of intVal. The statement will only return when the iteration of the loop is complete.
There are some limitation with the yield keywords.
Unsafe blocks are not allowed
Parameters to the method, operator, or accessor cannot be ref or out.
(More...)
which is the default property for all controls?
text property
(More...)
Default setting for the expires attribute of the document.cookie property?
The duration of the browser session.
(More...)
Quick Links For Interview Questions Categories:
ASP.Net
Windows Application
.NET Framework
C#
VB.Net
ADO.Net
Sql Server
SharePoint
Silverlight
OOPs
JQuery
JavaScript/VBScript
Biztalk
Patten/Practices
.IIS
WCF
WPF
WWF
Networking
Aptitude
Others
All
Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.
So, Start looking our
Interview Question
section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.
Hall of Fame
Twitter
Terms of Service
Privacy Policy
Contact Us
Archives
Tell A Friend