AmitDiwan has Published 10744 Articles

Type.GetEnumValues() Method in C#

AmitDiwan

AmitDiwan

Updated on 06-Nov-2019 07:10:29

359 Views

The Type.GetEnumValues() method in C# returns an array of the values of the constants in the current enumeration type.SyntaxFollowing is the syntax −public virtual Array GetEnumValues ();ExampleLet us now see an example to implement the Type.GetEnumValues() method −using System; public class Demo {    enum Vehicle {Car, Bus, Bike, Airplane} ... Read More

Type.GetEnumUnderlyingType() Method in C#

AmitDiwan

AmitDiwan

Updated on 06-Nov-2019 07:07:27

112 Views

The Type.GetEnumUnderlyingType() method in C# is used to return the underlying type of the current enumeration type.SyntaxFollowing is the syntax −public virtual Type GetEnumUnderlyingType ();ExampleLet us now see an example to implement the Type.GetEnumUnderlyingType() method −using System; public class Demo {    enum Vehicle {Car, Bus, Bike, Airplane}    public ... Read More

Type.GetEnumNames() Method in C#

AmitDiwan

AmitDiwan

Updated on 06-Nov-2019 07:03:50

99 Views

The Type.GetEnumNames() method in C# is used to return the names of the members of the current enumeration type.SyntaxFollowing is the syntax −public virtual string[] GetEnumNames ();ExampleLet us now see an example to implement the Type.GetEnumNames() method −using System; public class Demo {    enum Vehicle {Car, Bus, Bike}   ... Read More

How to create 1-Tuple or Singleton Tuple in C#?

AmitDiwan

AmitDiwan

Updated on 06-Nov-2019 06:59:07

155 Views

The Tuple class represents a 1-tuple, which is called singleton. A tuple is a data structure that has a sequence of elements.ExampleLet us now see an example to implement the 1-tuple in C# −using System; public class Demo {    public static void Main(string[] args) {       Tuple ... Read More

DateTimeOffset.FromUnixTimeSeconds() Method in C#

AmitDiwan

AmitDiwan

Updated on 06-Nov-2019 06:56:10

898 Views

The DateTimeOffset.FromUnixTimeSeconds() method in C# is used to convert a Unix time expressed as the number of seconds that have elapsed since 1970-01-01T00:00:00Z to a DateTimeOffset value.SyntaxFollowing is the syntax −public static DateTimeOffset FromUnixTimeSeconds (long val);Above, the parameter value is a Unix time, expressed as the number of seconds that ... Read More

DateTimeOffset.FromUnixTimeMilliseconds() Method in C#

AmitDiwan

AmitDiwan

Updated on 06-Nov-2019 06:54:05

1K+ Views

The DateTimeOffset.FromUnixTimeMilliseconds() method in C# is used to convert a Unix time expressed as the number of milliseconds that have elapsed since 1970-01-01T00:00:00Z to a DateTimeOffset value.SyntaxFollowing is the syntax −public static DateTimeOffset FromUnixTimeMilliseconds (long val);Above, Val are the milliseconds that have elapsed since 1970-01-01T00:00:00Z (January 1, 1970, at 12:00 ... Read More

Type.GetElementType() Method in C#

AmitDiwan

AmitDiwan

Updated on 06-Nov-2019 06:43:12

228 Views

The Type.GetElementType() method in C# is used to return the Type of the object encompassed or referred to by the current array, pointer or reference type.SyntaxFollowing is the syntax −public abstract Type GetElementType ();ExampleLet us now see an example to implement the Type.GetElementType() method −using System; public class Demo { ... Read More

Tuple Class in C#

AmitDiwan

AmitDiwan

Updated on 06-Nov-2019 06:32:34

152 Views

The Tuple class represents a 4-tuple, which is called quadruple. A tuple is a data structure that has sequence of elements.It is used in −Easier access to a data set.Easier manipulation of a data set.To represent a single set of data.To return multiple values from a methodTo pass multiple values ... Read More

Math.Tan() Method in C#

AmitDiwan

AmitDiwan

Updated on 06-Nov-2019 06:28:21

241 Views

The Math.Tan() method in C# is used to return the tangent of the specified angle.SyntaxFollowing is the syntax −public static double Tan (double val);Here, Val is the angle.ExampleLet us now see an example to implement Math.Tan() method −using System; public class Demo {    public static void Main(){     ... Read More

Math.Sqrt() Method in C#

AmitDiwan

AmitDiwan

Updated on 06-Nov-2019 06:26:41

5K+ Views

The Math.Sqrt() method in C# is used to compute the square root of the specified number.SyntaxFollowing is the syntax −public static double Sqrt (double val);Above, Val is the number for which we want the square root.ExampleLet us now see an example to implement Math.Sqrt() method −using System; public class Demo ... Read More

Advertisements