Convert Stack to array in C#

AmitDiwan
Published on 06-Dec-2019 06:45:52
To convert stack to the array, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       Stack<string> stack = new Stack<string>();       stack.Push("AB");       stack.Push("CD");       stack.Push("FG");       stack.Push("KL");   ... Read More

Convert Queue To array in C#

AmitDiwan
Published on 06-Dec-2019 06:42:26
To convert queue to the array, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       Queue<int> queue = new Queue<int>();       queue.Enqueue(100);       queue.Enqueue(200);       queue.Enqueue(300);       queue.Enqueue(400);   ... Read More

What are the scoping rules for lambda expressions in Java?

raja
Published on 06-Dec-2019 06:41:28
There are different scoping rules for lambda expression in Java. In lambda expressions, this and super keywords are lexically scoped means that this keyword refers to the object of the enclosing type and the super keyword refers to the enclosing superclass. In the case of an anonymous class, they are ... Read More

Get the number of elements contained in the Queue in C#

AmitDiwan
Published on 06-Dec-2019 06:33:50
To get the number of elements contained in the Queue, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       Queue<string> queue = new Queue<string>();       queue.Enqueue("Gary");       queue.Enqueue("Jack");       queue.Enqueue("Ryan"); ... Read More

Get the number of elements contained in SortedList in C#

AmitDiwan
Published on 06-Dec-2019 06:30:35
To get the number of elements contained in the SortedList, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(String[] args){       SortedList sortedList = new SortedList();       sortedList.Add("A", "1");       sortedList.Add("B", "2");     ... Read More

Get an enumerator that iterates through Collection in C#

AmitDiwan
Published on 06-Dec-2019 06:26:56
To get an enumerator that iterates through Collection, the code is as follows −Example Live Demousing System; using System.Collections.ObjectModel; public class Demo {    public static void Main(){       Collection<string> col = new Collection<string>();       col.Add("Andy");       col.Add("Kevin");       col.Add("John");       ... Read More

Get the number of elements actually contained in the ArrayList in C#

AmitDiwan
Published on 06-Dec-2019 06:23:50
To get the number of elements actually contained in the ArrayList, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(String[] args){       ArrayList list1 = new ArrayList();       list1.Add("A");       list1.Add("B");       ... Read More

Get the minimum value in the SortedSet in C#

AmitDiwan
Published on 06-Dec-2019 06:19:47
To get the minimum value in the SortedSet, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       SortedSet<string> set1 = new SortedSet<string>();       set1.Add("AB");       set1.Add("BC");       set1.Add("CD");       ... Read More

Get an enumerator that iterates through the Hashtable in C#

AmitDiwan
Published on 06-Dec-2019 06:16:23
To get an enumerator that iterates through the Hashtable, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(){       Hashtable hash = new Hashtable(10);       hash.Add("1", "A");       hash.Add("2", "B");       hash.Add("3", ... Read More

Removing all entries from HybridDictionary in C#

AmitDiwan
Published on 06-Dec-2019 06:12:17
To remove all entries from HybridDictionary, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main(){       HybridDictionary dict1 = new HybridDictionary();       dict1.Add("A", "Books");       dict1.Add("B", "Electronics");       dict1.Add("C", "Smart ... Read More
Previous 1 ... 4 5 6 7 8 9 10 ... 2909 Next
Advertisements