- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Samual Sam has Published 2492 Articles
Samual Sam
74 Views
Set an array −int[] arr = { 23, 66, 96, 110 };Now, create a new list −var list = new List();Use the Add method and add the array elements to the list −for (int i = 0; i < arr.Length; i++) { list.Add(arr[i]); }The following is the complete code ... Read More
Samual Sam
492 Views
To search files from the list of files in a directory, try to run the following code −Exampleusing System; using System.IO; namespace Demo { class Program { static void Main(string[] args) { //creating a DirectoryInfo object DirectoryInfo ... Read More
Samual Sam
484 Views
DynamicStore any type of value in the dynamic data type variable created using dynamic keyword. Type checking for these types of variables takes place at run-time. Dynamic are dynamically typed variables.The following is the syntax for declaring a dynamic type −dynamic = value;The following is an example −dynamic val1 ... Read More
Samual Sam
4K+ Views
Abstract methods do not provide an implementation and they force the derived classes to override the method. It is declared under abstract class. An abstract method only has the method definitionVirtual methods have an implementation, unlike the Abstract method and it can exist in the abstract and non-abstract class. It ... Read More
Samual Sam
115 Views
While creating a view, providing the list of columns is optional. The following example will illustrate by creating the views without any column list −mysql> Select * from student_detail; +-----------+-------------+------------+ | Studentid | StudentName | address | +-----------+-------------+------------+ | 100 | Gaurav | Delhi ... Read More
Samual Sam
1K+ Views
Under anagram, another string would have the same characters present in the first string, but the order of characters can be different.Here, we are checking the following two strings −string str1 = "silent"; string str2 = "listen";Convert both the strings into character array −char[] ch1 = str1.ToLower().ToCharArray(); char[] ch2 = ... Read More
Samual Sam
811 Views
Firstly, set the list −List myList = new List () { 5, 10, 7 };Now, set the value of a variable to 1 that would help us in multiplying −int prod = 1;Loop through and get the product −foreach(int i in myList) { prod = prod*i; ... Read More
Samual Sam
192 Views
To merge two sorted arrays into a list, firstly set two sorted arrays −int[] array1 = { 1, 2 }; int[] array2 = { 3, 4 };Add it to a list and merge −var list = new List(); for (int i = 0; i < array1.Length; i++) { list.Add(array1[i]); ... Read More
Samual Sam
737 Views
Firstly, set a tuple −Tuple t = Tuple.Create(99, 53);Now, convert the tuple to an array −int[] arr = new int[]{t.Item1, t.Item2};The following is the code to convert a tuple into an array −Example Live Demousing System; using System.Linq; using System.Collections.Generic; namespace Demo { public class Program { ... Read More
Samual Sam
549 Views
InheritanceWith Inheritance, you can designate that the new class should inherit the members of an existing class. This existing class is called the baseclass, and the new class is referred to as the derived class. Inheritance implements the IS-A relationship. For example, mammal IS A animal, dog IS-A mammal hence ... Read More