Tutorialspoint

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

Samual Sam
Answered 5h 26m ago

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

Properties of the Thread Class

Ankith Reddy
Answered 5h 26m ago

A thread is defined as the execution path of a program. Each thread defines a unique flow of control. The following are the properties of the Thread class − Sr.No. Property & Description 1 CurrentContext Gets the current context in which the thread is executing. ... Read More

What is the difference between a mutable and immutable string in C#?

karthikeya Boyini
Answered 5h 30m ago

Mutable string StringBuilder is a mutable string in C#. With StringBuilder, you can expand the number of characters in the string. The string cannot be changed once it is created, but StringBuilder can be expanded. It does not create a new object in the memory. Set StringBuilder − StringBuilder ... Read More

What is the BitArray class in C#?

Maheshwari Thakur
Answered 5h 31m ago

The BitArray class is used when you need to store the bits but do not know the number of bits in advance. The following are some of the properties of the BitArray class in C# − Sr.No. Property & Description 1 Count Gets the number of ... Read More

What is static binding in C#?

Samual Sam
Answered 5h 34m ago

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. void print(int i) { ... Read More

Write a C# program to check if the entered number is Armstrong number?

Chandu yadav
Answered 5h 34m ago

A number is an Armstrong number if the sum of the cube of each digit of the number is equal to the number itself. Here, we will find out the remainder and will sum it to the cube of remainder. rem = i % 10; sum = sum + ... Read More

What is method hiding in C#?

karthikeya Boyini
Answered 5h 38m ago

Method hiding is also known as shadowing. The method of the parent class is available to the child class without using the override keyword in shadowing. The child class has its own version of the same function. Use the new keyword to perform shadowing. Let us see an example. Example ... Read More

What is the difference between String.Copy() and String.CopyTo() methods in C#?

Maheshwari Thakur
Answered 5h 38m ago

String.CopyTo() method gets the string characters and places them into an array. A group of characters are copied from source string into a character array. The following is the Copy() method − Example Live Demo using System; class Demo { ... Read More

Write a C# program to do basic arithmetic calculations

Samual Sam
Answered 5h 41m ago

Let us do the following arithmetic calculations − Sr.No Operator & Description 1 + Adds two operands 2 - Subtracts second operand from the first 3 * Multiplies both operands 4 / Divides numerator by de-numerator The following ... Read More

Write a C# program to find GCD and LCM?

Ankith Reddy
Answered 5h 42m ago

GCD (Greatest Common Divisor) GCD is the largest positive integer that divides each of the integers. LCM (Least Common Multiple) LCM of two numbers is the smallest integer divisible by both the numbers. The following is an example to calculate the GCD and LCM. Here, we are calculating the LCM ... Read More

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

karthikeya Boyini
Answered 5h 45m ago

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. Interface Interfaces define properties, methods, and events, which are the members of the interface. Interfaces contain only the declaration of the members. It ... Read More

What is the difference between String.Copy() and String.Clone() methods in C#?

George John
Answered 5h 45m ago

The String.Copy() method creates a new instance of String. This is same as the specified String. The following is an example of Copy() method − Example Live Demo using System; class Demo { static void Main(String[] args) { ... Read More

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

Samual Sam
Answered 5h 52m ago

String stands for System.String whereas string is an alias in C# for System.String − For example string 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 ... Read More

What is the difference between literal and constant in C#?

Chandu yadav
Answered 5h 51m ago

The constants refer to fixed values that the program may not alter during its execution. These fixed values are also called literals. Constants can be of any of the basic data types like an integer constant, a floating constant, a character constant, or a string literal. There are also enumeration ... Read More

Cache Management

Alex Onsman
Answered 6h 45m ago

Cache is a type of memory that is used to increase the speed of data access. Normally, the data required for any process resides in the main memory. However, it is transferred to the cache memory temporarily if it is used frequently enough. A diagram to better understand the data ... Read More

Advertisements
Loading...
Unanswered Questions View All