I have create one console application with some new features in vs2015.Here I have used
1. Using static:( Accessible all static members)
Example- using static System.Math;
2. Expression bodies on method-like members
Please find the below code:
- using System;
-
- using static System.Math;
- namespace ConsoleApplication1 {
- class Program {
- static void Main(string[] args) {
- Program obj = new Program();
-
- Console.WriteLine(obj.GetString());
- Console.ReadLine();
- }
- public string X = "Hi";
- public string Y = "How";
- public Int32 FastValue = 4;
- public Int32 Secondvalue = 5;
-
- public double GetTotalValu() = > Sqrt(FastValue + Secondvalue * FastValue + Secondvalue);
- public double GetSqrt(int x) = > Sqrt(x);
-
- public string GetString() = > $ "({X},{Y})";
- }
- }
Output: