Ankith Reddy has Published 1070 Articles

What is encapsulation in C#?

Ankith Reddy

Ankith Reddy

Updated on 20-Jun-2020 13:14:00

313 Views

Encapsulation in C# prevents access to implementation details. Implement Encapsulation in C# using access specifiers.The following are the access specifiers supported by C# −PublicPrivateProtectedInternalProtected internalEncapsulation can be understood by taking an example of private access specifier that allows a class to hide its member variables and member functions from other ... Read More

What are some of the commonly used methods of the array class in C#?

Ankith Reddy

Ankith Reddy

Updated on 20-Jun-2020 13:09:59

167 Views

The Array class is the base class for all the arrays in C#. It is defined in the System namespace.The most commonly used methods of the array class are −Sr.No.Methods & Description1ClearSets a range of elements in the Array to zero, to false, or to null, depending on the element ... Read More

What are the differences between constructors and destructors in C#?

Ankith Reddy

Ankith Reddy

Updated on 20-Jun-2020 12:57:24

395 Views

ConstructorsA class constructor is a special member function of a class that is executed whenever we create new objects of that class.A constructor has exactly the same name as that of class and it does not have any return type.Constructor has the same name as the class name −class Demo ... Read More

How to calculate the length of the string using C#?

Ankith Reddy

Ankith Reddy

Updated on 20-Jun-2020 11:42:42

10K+ Views

Use the String.Length property in C# to get the length of the string.str.LengthThe property calculates the words in the string and displays the length of the specified string, for example, the string Amit has 4 characters −string str = "Amit";ExampleThe following is the C# program to calculate the string length ... Read More

What are the different wildcard characters that can be used with MySQL RLIKE operator?

Ankith Reddy

Ankith Reddy

Updated on 20-Jun-2020 11:03:30

377 Views

The use of wildcards with RLIKE operators can save a lot of effort when we write a query that looks for some pattern (regular expression) in character string. The wildcards used with RLIKE are:^ − It signifies BEGINING of the string. In other words when we use this wildcard with ... Read More

How to assign a reference to a variable in C#

Ankith Reddy

Ankith Reddy

Updated on 20-Jun-2020 10:57:25

4K+ Views

To assign reference to a variable, use the ref keyword. A reference parameter is a reference to a memory location of a variable. When you pass parameters by reference, unlike value parameters, a new storage location is not created for these parameters. Declare the reference parameters using the ref keyword.Let ... Read More

What is the Capacity property of SortedList class in C#?

Ankith Reddy

Ankith Reddy

Updated on 20-Jun-2020 10:45:43

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 { ... Read More

What MySQL returns if the list of strings, provided as argument in FIELD() function, are NULL?

Ankith Reddy

Ankith Reddy

Updated on 20-Jun-2020 08:43:16

65 Views

In case if all the arguments (list of strings) of FIELD() function are NULL then MySQL will return 0 as output.Examplemysql> Select FIELD('Ram',NULL,NULL,NULL,NULL); +----------------------------------+ | FIELD('Ram',NULL,NULL,NULL,NULL) | +----------------------------------+ |                               0  | +----------------------------------+ 1 row in set (0.00 sec)

What is the difference between CONCAT() and CONCAT_WS() functions?

Ankith Reddy

Ankith Reddy

Updated on 20-Jun-2020 08:31:58

8K+ Views

Both CONCAT() and CONCAT_WS() functions are used to concatenate two or more strings but the basic difference between them is that CONCAT_WS() function can do the concatenation along with a separator between strings, whereas in CONCAT() function there is no concept of the separator. Other significance difference between them is ... Read More

What is the importance of the order of Columns in the SET clause of UPDATE statement? Will it make big difference in result set returned by MySQL?

Ankith Reddy

Ankith Reddy

Updated on 20-Jun-2020 07:08:26

190 Views

The order of columns in the SET clause of UPDATE statement is important because MySQL provides us the updated value on columns names used in an expression. Yes, it will make big difference in the result set returned by MySQL. Following is an example to make it clear −ExampleIn this ... Read More

Advertisements