Samual Sam has Published 2492 Articles

What is the difference between Write() and WriteLine() methods in C#?

Samual Sam

Samual Sam

Updated on 22-Jun-2020 07:28:54

5K+ Views

The difference between Write() and WriteLine() method is based on new line character.Write() method displays the output but do not provide a new line character.WriteLine() method displays the output and also provides a new line character it the end of the string, This would set a new line for the ... Read More

Typeof() vs GetType() in C#

Samual Sam

Samual Sam

Updated on 22-Jun-2020 07:26:04

15K+ Views

Typeof()The type takes the Type and returns the Type of the argument.For example: System.Byte for the following −typeof(byte)The following is an example −Example Live Demousing System; class Program {    static void Main() {       Console.WriteLine(typeof(int));       Console.WriteLine(typeof(byte));    } }OutputSystem.Int32 System.ByteGetType()The GetType() method of array class ... Read More

Write a C# program to do basic arithmetic calculations

Samual Sam

Samual Sam

Updated on 22-Jun-2020 07:23:17

462 Views

Let us do the following arithmetic calculations −Sr.NoOperator & Description1+Adds two operands2-Subtracts second operand from the first3*Multiplies both operands4/Divides numerator by de-numeratorThe following is an example to perform arithmetic calculations using the above-given operators −Example Live Demousing System; namespace OperatorsApplication {    class Program {       static void ... Read More

What is static binding in C#?

Samual Sam

Samual Sam

Updated on 22-Jun-2020 07:21:02

732 Views

The linking of a function with an object during compile time is called static binding. C# provides two techniques to implement static polymorphism: Function overloading and Operator overloading.In Function Overloading, you can have multiple definitions for the same function name in the same scope.Examplevoid print(int i) {    Console.WriteLine("Printing int: ... Read More

What is the difference between an interface and an abstract class in C#?

Samual Sam

Samual Sam

Updated on 22-Jun-2020 07:17:37

435 Views

Interfaces define properties, methods, and events, which are the members of the interface. Interfaces contain only the declaration of the members. It is the responsibility of the deriving class to define the members.Abstract classes to some extent serve the same purpose, however, they are mostly used when only a few ... Read More

How does the precedence of || operator depend on PIPES_AS_CONCAT SQL mode?

Samual Sam

Samual Sam

Updated on 22-Jun-2020 06:23:31

134 Views

As we know that in MySQL by default || operator is a logical OR operator but it depends upon PIPES_AS_CONCAT SQL mode. If PIPES_AS_CONCAT SQL mode is enabled, then || operator works as string concatenation. At that time its precedence would be between ^ and the unary operator. Following example ... Read More

How MySQL evaluates when I use a conditional expression within SUM() function?

Samual Sam

Samual Sam

Updated on 22-Jun-2020 05:30:20

84 Views

As we know that, by using a conditional expression within SUM() function we can get the number of rows that meet the condition. So, in this case, MySQL evaluates to 1 each time the condition is true and 0 each time it is false.To understand it, consider the following example ... Read More

What is the difference between String and string in C#?

Samual Sam

Samual Sam

Updated on 21-Jun-2020 16:56:33

389 Views

String stands for System.String whereas string is an alias in C# for System.String −For examplestring str = "Welcome!";It’s not essential, but generally String is used when you work with classes.string str = String.Format("Welcome! {0}!", user);Since the string is an alias for System. String. The alias for other datatypes are −Exampleobject: ... Read More

System.ArrayCopyTo() vs System.ArrayClone() in C#

Samual Sam

Samual Sam

Updated on 21-Jun-2020 16:53:51

106 Views

The ArrayCopyTo() method copies all the elements of the current one-dimensional Array to the specified one-dimensional Array starting at the specified destination Array index. The index is specified as a 32-bit integer.The CopyTo() method in C# is used to copy elements of one array to another array. In this method, ... Read More

What are virtual functions in C#?

Samual Sam

Samual Sam

Updated on 21-Jun-2020 16:51:25

4K+ Views

The virtual keyword is useful in modifying a method, property, indexer, or event. When you have a function defined in a class that you want to be implemented in an inherited class(es), you use virtual functions. The virtual functions could be implemented differently in different inherited class and the call ... Read More

Advertisements