C Sharp Switch

C# switch To execute one statement from multiple conditions, either the switch statement or the if-else-if ladder statement can be used in C#. The use of the break statement is a must in the C# switch statement. Syntax: switch(expression){ case 1: //code to be executed; break; case 2: //code to be executed; break; …… default: … Read more

Categories C#

C Sharp if else

C# if-else To test a condition or multiple conditions, C# provides various types of if statements. These are: if statement if-else statement nested if statement if-else-if ladder C# IF Statement: The C# IF statement is used to test the condition and then to execute the specified code if the condition is true. Syntax: if(condition){ //code … Read more

Categories C#

C Sharp Keywords

C# Keywords A keyword is a reserved word which cannot be used as a variable name, constant name, identifiers, etc. The keyword in C# needs to be prefixed with @ character, to use a keyword as an identifier. Listed below are the reserved Keywords available in C# programming language: abstract base as bool break byte … Read more

Categories C#

C Sharp Operators

C# operators The symbols used to perform operations like arithmetic, logical, bitwise, etc. are known as operators. Different types of operations can be performed in C# language using the different types of operators that are listed below: Arithmetic Operators Relational Operators Logical Operators Bitwise Operators Assignment Operators Unary Operators Ternary Operators Misc Operators Precedence and … Read more

Categories C#

C Sharp Data Types

The type of data that a variable can store is specified by a data type. The type of data can be integer, floating, character, etc. In C# language, there are 3 types of data types. Types Data Types Value Data Type short, int, char, float, double etc Reference Data Type String, Class, Object and Interface … Read more

Categories C#

C Sharp Variable

C# Variable A variable is used to store data to a memory location. It thus specifies the name of the memory location. As the name itself suggests, the value of a variable can vary and thus can be reused multiple times. To easily identify a memory location, it represents a memory location through a symbol. … Read more

Categories C#

C Sharp Hello World

C# Example There are multiple ways to write even a simple program like “Hello World” in C# programming language. We are discussing below only the most recommended four ways to write a simple program in C#. Simple Example Using System Using public modifier Using namespace Example 1: C# Simple Example. class Example { static void … Read more

Categories C#

C Sharp Features

C# Features Being an object-oriented programming language, C# facilitates many crucial features. Some of the major features of C# are listed and are discussed below. Simple programming language Modern programming language Object-oriented programming language Type-safe Interoperability Scalable and Updateable Component oriented programming language Structured programming language Rich Library Fast speed Simple programming language: To break … Read more

Categories C#

Java vs C sharp

Java vs C# Java and C# shares many similarities between them. But they also holds some major differences that are listed below: Java C# Developed by Oracle. Developed by Microsoft. High level, robust, secured and object-oriented programming language. Object-oriented programming language. Run on a Java platform with the help of the Java Runtime Environment (JRE). … Read more

Categories C#