Check if the ArrayList has a fixed size in C#

AmitDiwan
Published on 06-Dec-2019 11:24:38
To check if the ArrayList has a fixed size, 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("One");       list1.Add("Two");       list1.Add("Three"); ... Read More

Check if ArrayList is Synchronized (thread safe) in C#

AmitDiwan
Published on 06-Dec-2019 11:22:20
To check if ArrayList is synchronized, 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");       list1.Add("C");       ... Read More

Check if StringDictionary is synchronized in C#

AmitDiwan
Published on 06-Dec-2019 10:58:07
To check if StringDictionary is synchronized, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main() {       StringDictionary strDict1 = new StringDictionary();       strDict1.Add("A", "John");       strDict1.Add("B", "Andy");       strDict1.Add("C", ... Read More

Check if a SortedList object is synchronized in C#

AmitDiwan
Published on 06-Dec-2019 10:54:02
To check if a SortedList object is synchronized, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main() {       SortedList list = new SortedList();       list.Add("1", "One");       list.Add("2", "Two");       list.Add("3", ... Read More

Check if ListDictionary has a fixed size in C#

AmitDiwan
Published on 06-Dec-2019 10:50:27
To check if ListDictionary has a fixed size, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main() {       ListDictionary dict1 = new ListDictionary();       dict1.Add("A", "Books");       dict1.Add("B", "Electronics");     ... Read More

Check if ListDictionary contains a specific key in C#

AmitDiwan
Published on 06-Dec-2019 10:43:39
To check if ListDictionary contains a specific key, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main() {       ListDictionary dict1 = new ListDictionary();       dict1.Add("A", "Books");       dict1.Add("B", "Electronics");   ... Read More

Getting an enumerator that iterates through HashSet in C#

AmitDiwan
Published on 06-Dec-2019 10:38:14
To get an enumerator that iterates through HashSet, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(String[] args) {       HashSet<string> set1 = new HashSet<string>();       set1.Add("A");       set1.Add("B");       set1.Add("C");   ... Read More

How to get the HashCode for the string in C#?

AmitDiwan
Published on 06-Dec-2019 10:30:55
To get the HashCode for the string, the code is as follows, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main(String[] args) {       string str1 = "Akon";       string str2 = "Eminem";       Console.WriteLine("String 1 ... Read More

How to write the comparator as a lambda expression in Java?

raja
Published on 06-Dec-2019 10:26:25
A lambda expression is an anonymous method and doesn't execute on its own in java. Instead, it is used to implement a method defined by the functional interface. A lambda expression used with any functional interface and Comparator is a functional interface. The Comparator interface has used when sorting a collection of objects ... Read More

Get the number of nodes contained in LinkedList in C#

AmitDiwan
Published on 06-Dec-2019 10:24:07
To get the number of nodes contained in the LinkedList, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main() {       LinkedList<String> list = new LinkedList<String>();       list.AddLast("A");       list.AddLast("B");       list.AddLast("C"); ... Read More
Advertisements