Hi Guest

MobileUser

1 HomePage 1 Jobs 1 WalkIn 1Articles  

Cat Exam

 :) Latest Topic
AJAX
VB.NET
SQL Query
UDDI
CLASS
JavaScript Questions
SharePoint Interview
SilverLight
WCF
general knowledge
 ASP.NET
 :) Hot Jobs
 
 :) Latest Articles


  

 


What are the new feature of C# 11 that is coming?
Question Posted on 01 Mar 2022

Home >> DotNet >> C# >> What are the new feature of C# 11 that is coming?




What are the new feature of C# 11 that is coming?
C# 10 is recently released and C# 11 is in progress. There are many new features are included in this version of C#. Below are the list of new features of C#:-

(1)New List Pattern
New feature of List Pattern which allows us to do comparison between List Pattern and array or List. Here you will able to match different elements or even a cut pattern to match 0 or more elements. To understand this we we will take example as given below:-
Pattern [1, 2, .., 10] matches all below example:-



List Pattern Match

And to explore list pattern we consider below example:-



List Pattern Consider

When it is passed the following arrays the results are as indicated at end of line:-



List Pattern Consider Val

(2)Parameter Null Checking
This is basically handle null and to validate if the method argument are null. Below example will more clarify:-
(i)In old code we use below parameter


Old Check Null

(ii)And now we can use below abbreviation for treating null values



Null Check Pattern

(iii)Below example of checking indexer parameter with set and get



Get Set null

(3)Constructors
Change in null-checks using the null validation syntax (!!). And explicit validation occurs after field initializers, base class constructors, and constructors called using this.


(4)Interaction with Nullable Reference Types
!! operator we have seen before, it will start as non-null with a nullable state. BElow example will clarify you more:-



checking null T
0
0



 
 Input Your Comments Or suggestions(If Any)
 Name
 Email(optional)
 Comments


Other Important Questions
Simplest definition of partial classes and its rules?
Definition of Tuple class with some examples?
Define Race Condition in cSharp?
C#.Net Reserve Words
can we inherit private class level variables in c#






 
Top Searches:asp net questions vb net questions sql query uddl questions class javascript Questions sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |