Sitemap
Pramod Pattade

Pramod Pattade

C#(c-Sharp)

3 min readFeb 27, 2020

--

C# is pronounced as C-Sharp. It is an object-oriented programming language provided by Microsoft that runs on .Net Framework.C# has roots from the C family.

The first c# version was released in the year 2002. The latest version of c# is “C# 8 ” which was released in September 2019.

C# is used for:

  • Window applications
  • Web applications
  • Distributed applications
  • Web service applications
  • Database applications etc.

C# Syntax:

using System: we can use classes from the System namespace.

namespace: It is used to organize your code.

class: It is a keyword that is used to define a class.

(string[] args): It is used for command-line arguments in C#.

Console: It is a class of the system namespace

Get Pramod Pattade’s stories in your inbox

Join Medium for free to get updates from this writer.

writeLine(): Method that is used to output/print text.

C# Method:

A method is a block of code that only runs when it is called. You can pass data, known as parameters, into a method. Methods are used to perform certain actions, and they are also known as Function.

In this figure. how to create a method And to call the method.

A method can be called multiple times.

C# Method Parameters:

Parameters and Arguments: Information can be passed to methods as a parameter. Parameters act as variables inside the method. They are specified after the method name, inside the parentheses.

Output

Default Parameter Value: You can also use a default parameter value, by using the equals sign (=).

OutPut

Method Overloading:

writing two or more methods with the same name but with a different signature.

OutPut

If you are new to C# start with the following must-watch video

--

--