Chandu yadav has Published 1163 Articles

What are key-based I/O collections in C#?

Chandu yadav

Chandu yadav

Updated on 20-Jun-2020 16:38:04

141 Views

The key-based I/O Collections in C# is what we call a SortedList −SortedListThe SortedList class represents a collection of key-and-value pairs that are sorted by the keys and are accessible by key and by index. This is how both of them gets added in a SortedList −s.Add("Sub1", "Physics"); s.Add("Sub2", "Chemistry"); ... Read More

What are overloaded indexers in C#?

Chandu yadav

Chandu yadav

Updated on 20-Jun-2020 16:35:18

535 Views

An indexer in C# allows an object to be indexed such as an array. When an indexer for a class is defined, this class behaves similar to a virtual array. You can then access the instance of this class using the array access operator ([ ]).Indexers can be overloaded. Indexers ... Read More

What are I/O classes in C#?

Chandu yadav

Chandu yadav

Updated on 20-Jun-2020 16:22:55

640 Views

The System.IO namespace has various classes useful for performing various operations with files, such as creating and deleting files, reading from or writing to a file, closing a file etc.The following are the I/O classes in C# −Sr.No.I/O Class & Description1BinaryReaderReads primitive data from a binary stream.2BinaryWriterWrites primitive data in ... Read More

Integer literals vs Floating point literals in C#

Chandu yadav

Chandu yadav

Updated on 20-Jun-2020 16:16:35

299 Views

Integer LiteralsAn integer literal can be a decimal, or hexadecimal constant. A prefix specifies the base or radix: 0x or 0X for hexadecimal, and there is no prefix id for decimal. Here are some of the examples of integer literals −10 // int 18u // unsigned intLet’s use the above ... Read More

What are the C++ features missing in C#?

Chandu yadav

Chandu yadav

Updated on 20-Jun-2020 16:12:29

185 Views

C# is a simple, modern, general-purpose, object-oriented programming language developed by Microsoft within its .NET initiative led by Anders Hejlsberg.C++ is a middle-level programming language developed by Bjarne Stroustrup starting in 1979 at Bell Labs. C++ runs on a variety of platforms, such as Windows, Mac OS, and the various ... Read More

Trigonometric Functions in C#

Chandu yadav

Chandu yadav

Updated on 20-Jun-2020 16:10:23

2K+ Views

Trignometric Functions in C# include, ACos, ASin, Sin, Cos, Tan, etc. It comes under the Math type of the System namespace.The following is an example showing how to implement trigonometric functions in C# −Example Live Demousing System; class Program {    static void Main() {       Console.WriteLine(Math.Acos(0));   ... Read More

How to delete/remove an element from a C# array?

Chandu yadav

Chandu yadav

Updated on 20-Jun-2020 16:06:09

9K+ Views

To delete an elements from a C# array, we will shift the elements from the position the user want the element to delete.Here, first we have 5 elements −int[] arr = new int[5] {35, 50, 55, 77, 98};Now let’s say we need to delete the element at 2nd position i.e. ... Read More

Time Functions in C#

Chandu yadav

Chandu yadav

Updated on 20-Jun-2020 16:02:46

623 Views

The DateTime has methods and properties for Date and Time as well like how to get the number of hours or minutes of a day, etc.Let us only focus on the time functions −Refer MSDN (Microsoft Developer Network) for all the functions −Sr.No.Method & Properties1AddDays(Double)Returns a new DateTime that adds ... Read More

What is a parameterized constructor in C# programs?

Chandu yadav

Chandu yadav

Updated on 20-Jun-2020 15:52:22

3K+ Views

In a constructor you can also add parameters. Such constructors are called parameterized constructors. This technique helps you to assign initial value to an object at the time of its creation.The following is an example −// class class DemoParameterized constructor with a prarameter rank −public Demo(int rank) { Console.WriteLine("RANK = ... Read More

What are the different access specifiers in C#.NET?

Chandu yadav

Chandu yadav

Updated on 20-Jun-2020 15:27:58

5K+ Views

The following are the access specifiers supported by C#.NET −Public Access SpecifierIt allows a class to expose its member variables and member functions to other functions and objects.Private Access SpecifierPrivate access specifier allows a class to hide its member variables and member functions from other functions and objects. Only functions ... Read More

Advertisements