- 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
Found 34486 Articles for Programming
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
700 Views
Bitwise Left shift operatorThe left operands value is moved left by the number of bits specified by the right operand.Bitwise Right shift operatorThe left operands value is moved right by the number of bits specified by the right operand.The following is an example showing how to work with Bitwise left and right shift operators −Example Live Demousing System; namespace Demo { class Program { static void Main(string[] args) { int a = 60; /* 60 = 0011 1100 */ int b = 13; /* 13 = 0000 1101 */ int c = 0; c = a > 2; /* 15 = 0000 1111 */ Console.WriteLine("Value of c is {0}", c); Console.ReadLine(); } } }OutputValue of c is 240 Value of c is 15
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
73 Views
Like any other object-oriented language, C# also has object and classes. Objects are real-world entities and instance of a class. Access the members of the class using an object.To access the class members, you need to use the dot (.) operator after the object name. The dot operator links the name of an object with the name of a member, for example, Box Box1 = new Box();Above you can see Box1 is our object. We will use it to access the members −Box1.height = 7.0;You can also use it to call member functions −Box1.getVolume();The following is an example showing how ... Read More
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
79 Views
Example Live Demousing System; using System.Collections; namespace Demo { class Program { static void Main(string[] args) { SortedList s = new SortedList(); s.Add("S1", "Electronics"); s.Add("S2", "Clothing"); s.Add("S3", "Applicances"); s.Add("S4", "Books"); s.Add("S5", "Accessories"); s.Add("S6", "Musical Instruments"); Console.WriteLine("Count = " + s.Count); } } }OutputCount = 6
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
182 Views
To find how many elements are added in the Stack class, you need to use the Count property.Let us first add elements in the Stack −Stack st = new Stack(); st.Push('H'); st.Push('I'); st.Push('J'); st.Push('K'); st.Push('L'); st.Push('M'); st.Push('N'); st.Push('O');Now count the number of elements in the Stack −Console.WriteLine("Count: "+st.Count);Let us see the complete code −Example Live Demousing System; using System.Collections; namespace Demo { class Program { static void Main(string[] args) { Stack st = new Stack(); st.Push('H'); st.Push('I'); st.Push('J'); ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
92 Views
Use the Count property to find the count of elements of the Queue class. Set elements like the following declaration −Queue q = new Queue(); q.Enqueue(1); q.Enqueue(2); q.Enqueue(3); q.Enqueue(4);Then use the Count property to count the elements −q.CountThe following is an example showing how to work with Count property in Queue Class −Example Live Demousing System; using System.Collections; namespace Demo { class Program { static void Main(string[] args) { Queue q = new Queue(); q.Enqueue(1); q.Enqueue(2); q.Enqueue(3); q.Enqueue(4); Console.WriteLine("Total elements: {0} ", q.Count); Console.ReadKey(); } } }OutputTotal elements: 4
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
80 Views
To find the count of elements of Hashtable class, use the Count property. Firstly, set the Hashtable class with elements −Hashtable ht = new Hashtable(); ht.Add("One", "Tom"); ht.Add("Two", "Jack"); ht.Add("Three", "Peter"); ht.Add("Four", "Russel"); ht.Add("Five", "Brad"); ht.Add("Six", "Bradley"); ht.Add("Seven", "Steve"); ht.Add("Eight", "David");Now, count the number of elements using the Count property −ht.CountThe following is the complete example to learn about the usage of Hashtable Count property in C#.Example Live Demousing System; using System.Collections; namespace Demo { class Program { static void Main(string[] args) { Hashtable ht = new Hashtable(); ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
89 Views
Count the number of elements in the BitArray class using the Count property.Let us first set our BitArray class −BitArray arr = new BitArray(10);Now use the Count property as shown below −Example Live Demousing System; using System.Collections; public class Demo { public static void Main() { BitArray arr = new BitArray(10); Console.WriteLine( "Count: {0}", arr.Count ); } }OutputCount: 10
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
199 Views
The capacity property in SortedList class has the maximum size of the SortedList.The default capacity of a SortedList is 16.You can try to run the following the code to implement Capacity property of SortedList class in C# −Example Live Demousing System; using System.Collections; namespace Demo { class Program { static void Main(string[] args) { SortedList s = new SortedList(); s.Add("S1", "Maths"); s.Add("S2", "Science"); s.Add("S3", "English"); s.Add("S4", "Economics"); Console.WriteLine("Capacity = " ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
216 Views
The Count property in the ArrayList class counts the number of elements in the ArrayList.Firstly, add elements to the ArrayList −ArrayList arrList = new ArrayList(); arrList.Add(98); arrList.Add(55); arrList.Add(65); arrList.Add(34);Then get the count of the array list −arrList.CountThe following is the code to implement Count property in C# −Example Live Demousing System; using System.Collections; class Demo { public static void Main() { ArrayList arrList = new ArrayList(); arrList.Add(98); arrList.Add(55); arrList.Add(65); arrList.Add(34); Console.WriteLine("Count = " + arrList.Count); } }OutputCount = 4
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
3K+ Views
The capacity property in ArrayList class gets or sets the number of elements that the ArrayList can contain.Capacity is always greater than count. For capacity property −arrList.CapacityThe default capacity is 4. If 5 elements are there, then its capacity is doubled and would be 8. This goes on.You can try to run the following the code to implement Capacity property in C#. This also shows what we discussed above −Example Live Demousing System; using System.Collections; class Demo { public static void Main() { ArrayList arrList = new ArrayList(); arrList.Add(19); arrList.Add(44); ... Read More