Karthikeya Boyini has Published 2193 Articles

How can we use MySQL SUM() function with HAVING clause?

karthikeya Boyini

karthikeya Boyini

Updated on 22-Jun-2020 05:06:51

2K+ Views

By using MySQL SUM() function with the HAVING clause, it filters the result based on a specific condition given after the HAVING clause. To understand the above concept, consider an ‘employee_tbl’ table, which is having the following records −mysql> SELECT * FROM employee_tbl; +------+------+------------+--------------------+ | id   | name | ... Read More

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

karthikeya Boyini

karthikeya Boyini

Updated on 21-Jun-2020 16:54:30

1K+ Views

An interface is a class without fields or method implementation. It cannot implement the methods it defines.A class generally implements the methods defined in an interface.InterfaceInterfaces define properties, methods, and events, which are the members of the interface. Interfaces contain only the declaration of the members. It is the responsibility ... Read More

Write a C# program to solve FizzBuzz problem

karthikeya Boyini

karthikeya Boyini

Updated on 21-Jun-2020 16:52:30

343 Views

The FizzBuzz problem states that −Display "Fizz" instead of the number for each multiple of 3, Display "Buzz", instead of the number for each multiple of 5.Display "FizzBuzz", instead of the number for each multiple of 5 & 3Let us see how to implement the above using C# −Exampleusing System; ... Read More

Static vs. Non-Static method in C#

karthikeya Boyini

karthikeya Boyini

Updated on 21-Jun-2020 16:36:07

1K+ Views

Declare a member function as static. Such functions can access only static variables. The static functions exist even before the object is created.A static class cannot be instantiated and can only contain static members.Static methods is set using static keyword −public static int getNum() {    return num; }The following ... Read More

Retrieving Elements from Collection in C#

karthikeya Boyini

karthikeya Boyini

Updated on 21-Jun-2020 16:31:09

855 Views

Let us see an example of a list collection.We have set the elements −List list = new List(); list.Add(20); list.Add(40); list.Add(60); list.Add(80);Now let’s say we need to retrieve the first element from the list. For that, set the index like this −int a = list[0];The following is an example showing ... Read More

Virtual vs Sealed vs New vs Abstract in C#

karthikeya Boyini

karthikeya Boyini

Updated on 21-Jun-2020 16:28:08

4K+ Views

VirtualThe virtual keyword allows a class to be overridden. For overriding a parent class method in the child class, declare the parent class method as virtual.SealedWhen a class is declared sealed, it cannot be inherited, abstract classes cannot be declared sealed.To prevent being overridden, use the sealed in C#. When ... Read More

How to swap two numbers without using a temp variable in C#

karthikeya Boyini

karthikeya Boyini

Updated on 21-Jun-2020 16:24:18

829 Views

To swap two numbers, use the third variable and perform arithmetical operator without using a temp variable.Set two variables for swapping −val1 = 5; val2 = 10;Now perform the following operation for swap −val1 = val1 + val2; val2 = val1 - val2; val1 = val1 - val2;Exampleusing System; namespace ... Read More

Timer in C#

karthikeya Boyini

karthikeya Boyini

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

3K+ Views

The namespace used to set a timer is System. Timers. The Timer class generates an event after a set interval, with an option to generate recurring events.Firstly, create a timer object for 5 seconds interval −timer = new System.Timers.Timer(5000);Set elapsed event for the timer. This occurs when the interval elapses ... Read More

Private Variables in C#

karthikeya Boyini

karthikeya Boyini

Updated on 21-Jun-2020 16:12:36

6K+ Views

Private access specifier allows a class to hide its member variables and member functions from other functions and objects. Only functions of the same class can access its private members. Even an instance of a class cannot access its private members.Create a private variable −private double length;Let us see an ... Read More

Mutation Test tools in C#

karthikeya Boyini

karthikeya Boyini

Updated on 21-Jun-2020 16:10:08

335 Views

One of the best tools for mutation testing in C# is “VisualMutator” It is integrated with the .NET programming environment.The following are the features of VisualMutant, which is a mutation test tool −Measure the quality of the test suite.To create first-order mutants using built-in and custom mutation operators.View modified code ... Read More

Advertisements