Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Csharp Articles
Page 195 of 196
Access Modifiers in C#
Access modifiers in C# control the visibility and accessibility of classes, methods, properties, and other members. They define which parts of your code can access specific members, providing encapsulation and security to your applications. Access Modifiers Overview C# provides five access modifiers that determine the scope and accessibility of class members − C# Access Modifiers Hierarchy public Most accessible protected internal internal protected private ...
Read MoreA Deque Class in C#
A Deque (double-ended queue) is a data structure that allows insertion and deletion of elements from both ends. In C#, while there's no built-in Deque class, we can implement one using a doubly-linked list or utilize existing collections like LinkedList to achieve deque functionality. The key advantage of a deque is its flexibility — you can add and remove elements from both the front and back, making it suitable for scenarios like implementing sliding window algorithms, browser history, or undo/redo operations. Deque Operations A typical deque supports the following core operations − AddFirst() — adds ...
Read MoreBeginning C# programming with Hello World
The following is a simple "Hello World" program in C# programming. This is typically the first program you write when learning a new language, and it demonstrates the basic structure of a C# application. Syntax Following is the basic structure of a C# program − using System; namespace NamespaceName { class ClassName { static void Main(string[] args) { // Your code here } } } Hello ...
Read MoreAbstract Classes in C#
An abstract class in C# includes both abstract and non-abstract methods. A class is declared abstract using the abstract keyword. You cannot instantiate an abstract class directly — it must be inherited by a derived class that provides implementations for all abstract methods. Syntax Following is the syntax for declaring an abstract class and an abstract method − public abstract class ClassName { // Abstract method — no body, must be overridden public abstract void MethodName(); // Non-abstract method — has a body, can be inherited ...
Read More'this' keyword in C#
The this keyword in C# is used to refer to the current instance of the class. It is also used to differentiate between method parameters and class fields when they have the same name. Another usage of the this keyword is to call another constructor from a constructor in the same class, known as constructor chaining. Syntax Following is the syntax for using this to refer to instance members − this.fieldName = value; Following is the syntax for constructor chaining using this − public ClassName(int a) : this(a, 0) { ...
Read MoreDifference between JavaScript and C#
JavaScript and C# are two popular programming languages that serve different purposes in software development. JavaScript is primarily used for web development, creating dynamic and interactive websites that run in browsers. C# is Microsoft's object-oriented programming language used for desktop applications, web backends, mobile apps, and games. JavaScript is a client-side language that executes in web browsers, making it essential for frontend development. It's beginner-friendly with a low learning curve and can run directly without compilation. C# is a compiled, statically-typed language that requires more programming knowledge but offers better performance and structure for complex applications. What is ...
Read MoreDifference between readonly and const keyword in C#
In C#, both readonly and const are used to create fields whose values cannot be modified after being set. The key difference is when the value is determined − const is resolved at compile time, while readonly is resolved at runtime (in the constructor). const Keyword The const keyword creates a compile-time constant. The value must be assigned at the time of declaration and cannot be changed afterward. const fields are implicitly static and can be declared inside methods. readonly Keyword The readonly keyword creates a runtime constant. The value can be assigned either at declaration ...
Read MoreDifference between system level exception and Application level exception.
An exception is an unwanted event that interrupts the normal flow of a program. In C#, exceptions are broadly categorized into System Level Exceptions (thrown by the CLR for fatal errors) and Application Level Exceptions (thrown by application code for recoverable errors). System Level Exception System level exceptions are derived from System.SystemException and are thrown by the .NET Common Language Runtime (CLR). They represent non-recoverable or fatal errors such as stack overflow, out of memory, null reference, or database crashes. These exceptions are generally not handled by application code. Common examples − NullReferenceException, StackOverflowException, OutOfMemoryException, IndexOutOfRangeException. ...
Read MoreDifference between var and dynamic in C#
In C#, var and dynamic are two ways to declare variables without explicitly specifying the type. The key difference is when the type is determined − var resolves the type at compile time, while dynamic resolves it at runtime. var (Implicitly Typed) var was introduced in C# 3.0. It is a statically typed variable whose data type is inferred by the compiler at compile time based on the value assigned during initialization. A var variable must be initialized at the time of declaration, otherwise the compiler throws an error. dynamic (Dynamically Typed) dynamic was introduced in ...
Read MoreUpgraded to SAP.net connector 3.0 is not working in Visual Studio 2008 and 2010
Note that SAP.NET Connector 3.0 doesn’t work similar to the 2.0 connector. There are many significant changes − both improvements and modifications − provided in the .NET 3.0 version. SAP.NET Connector 3.0 Overview SAP .NET Connector 3.0 is the current version of SAP's development environment for communication between the Microsoft .NET platform and SAP systems. With the use of SAP.NET connector, you can connect SAP system to all common programming languages like Visual Basic.NET, C#, or Managed C++ and many more. This is the official SAP documentation link about general capabilities of SAP.NET connector − ...
Read More