- 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
Karthikeya Boyini has Published 2383 Articles
karthikeya Boyini
364 Views
To get the binary of Decimal, using recursion, firstly set the decimal number −int dec = 30;Now pass the value to a function −public int displayBinary(int dec) { }Now, check the condition until the decimal value is 0 and using recursion get the mod 2 of the decimal num as ... Read More
karthikeya Boyini
556 Views
Set the string as empty using the string.Empty in C# −string myStr = string.Empty;To check whether it is a string or not, use the IsNullOrEmpty() method −if (string.IsNullOrEmpty(myStr)) { Console.WriteLine("String is empty or null!"); }The following is an example −Example Live Demousing System; namespace Demo { public class ... Read More
karthikeya Boyini
954 Views
A nested class is a class declared in another enclosing class and it has inner as well as outer class. It is a member of its enclosing class and the members of an enclosing class have no access to members of a nested classLet us see an example code snippet ... Read More
karthikeya Boyini
58 Views
Declaring an array does not initialize the array in the memory. When the array variable is initialized, you can assign values to the array.The following is a declaration and it will not create an array −int[] id;The following create an array of integers. The array is a reference type, so ... Read More
karthikeya Boyini
165 Views
To get the status of current thread, use the IsAlive() method −Firstly, create a new thread −Thread t = Thread.CurrentThread; t.Name = "Our Thread";Now, to get the status of the current thread −t.IsAliveThe following is the complete code −Example Live Demousing System; using System.Threading; namespace Demo { class MyClass ... Read More
karthikeya Boyini
402 Views
To insert an item in an already created ArrayList, use the Insert() method.Firstly, set elements −ArrayList arr = new ArrayList(); arr.Add(45); arr.Add(78); arr.Add(33);Now, let’s say you need to insert an item at 2nd position. For that, use the Insert() method −// inserting element at 2nd position arr.Insert(1, 90);Let us ... Read More
karthikeya Boyini
1K+ Views
C# has no built-in Math type. For the same, use a Dictionary.Firstly, create a Dictionary −Dictionary d = new Dictionary(); d.Add("keyboard", 1); d.Add("mouse", 2);Get the keys −var val = d.Keys.ToList();Now, use the foreach loop to iterate over the Map −foreach (var key in val) { Console.WriteLine(key); }To iterate ... Read More
karthikeya Boyini
63 Views
It can be done with the help of the following query −mysql> SELECT trigger_name, action_order FROM INFORMATION_SCHEMA.triggers WHERE TRIGGER_SCHEMA = 'query' ORDER BY event_object_table, action_timing, event_manipulation; +------------------------------+--------------+ | trigger_name | action_order | +------------------------------+--------------+ | studentdetail_before_update | 1 ... Read More
karthikeya Boyini
352 Views
Firstly, add elements −IDictionary d = new Dictionary(); d.Add(1, 97); d.Add(2, 89); d.Add(3, 77); d.Add(4, 88);Now, get the keys −List myList = new List(d.Keys);To iterate −foreach (int k in myList) { Console.WriteLine("{0}, {1}", k, d[k]); }The following is an example −Example Live Demousing System; using System.Collections.Generic; public class Demo ... Read More
karthikeya Boyini
310 Views
Firstly, use the DirectoryInfo object −//creating a DirectoryInfo object DirectoryInfo mydir = new DirectoryInfo(@"d:\amit");Now, use the GetFiles() method to get all the files −FileInfo [] f = mydir.GetFiles();To get the list of files in a directory, try to run the following code −Exampleusing System; using System.IO; namespace Demo { ... Read More