- 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
2K+ Views
Check for the following conditions −For odd and even, check for the remainder when the number is divided by 2 −// checking for odd/ even if(n % 2 == 0) { Console.WriteLine("Even"); } else { Console.WriteLine("Odd"); }For positive, negative and checking whether a number is 0 or not ... Read More
karthikeya Boyini
3K+ Views
By executing SELECT @@TX_ISOLATION command we can check the current MySQL transaction isolation level.Examplemysql> SELECT @@TX_ISOLATION; +-----------------+ | @@TX_ISOLATION | +-----------------+ | REPEATABLE-READ | +-----------------+ 1 row in set (0.00 sec)
karthikeya Boyini
513 Views
The flow control in try, catch, and finally can be understood using the following example. Here, we are dividing two numbers −Example Live Demousing System; namespace ErrorHandlingApplication { class DivNumbers { int result; DivNumbers() { result = 0; ... Read More
karthikeya Boyini
397 Views
To print “Hello World” in C#, use the Console.WriteLine.Let us see a basic C# program to display a text −Example Live Demousing System; using System.Collections.Generic; using System.Text; namespace Program { class MyApplication { static void Main(string[] args) { Console.WriteLine("Hello World"); ... Read More
karthikeya Boyini
335 Views
Declare an array and initialize −int[] arr = new int[] { 87, 23, 65, 29, 67 };To sort, use the Sort() method and CompareTo() to compare and display in decreasing order −Array.Sort < int > (arr, new Comparison < int > ((val1, val2) => val2.CompareTo(val1)));Let ... Read More
karthikeya Boyini
13K+ Views
Use the DateTime.TryParseExact method in C# for Date Format validation.They method converts the specified string representation of a date and time to its DateTime equivalent. It checks whether the entered date format is correct or not.Example Live Demousing System; using System.Globalization; namespace Demo { class Program { ... Read More
karthikeya Boyini
1K+ Views
Set two arrays that you wish to merge −int[] arr1 = new int[5] { 5, 15, 25, 30, 47 }; int[] arr2 = new int[5] { 55, 60, 76, 83, 95 };Now take a third array that would merge both ... Read More
karthikeya Boyini
151 Views
Boxing is implicit and unboxing is explicit. Unboxing is the explicit conversion of the reference type created by boxing, back to a value type.Let us see an example of variable and object in C# −// int int x = 30; // Boxing object obj = x; // Un ... Read More
karthikeya Boyini
3K+ Views
Singleton Class allow for single allocations and instances of data. It has normal methods and you can call it using an instance.To prevent multiple instances of the class, the private constructor is used.Let us see an example −public class Singleton { static Singleton b = null; private Singleton() ... Read More
karthikeya Boyini
874 Views
In C#, Task parallelism divide tasks. The tasks are then allocated to separate threads for processing. In .NET, you have the following mechanisms to run code in parallel: Thread, ThreadPool, and Task. For parallelism, use tasks in C# instead of Threads.A task will not create its own OS thread, whereas ... Read More