Skip to main content

C# Basic

C# is a general purpose modern object oriented programming language with multiple paradigms. It was designed for Common Language Infrastructure (CLI) in 2000 by Microsoft for its .NET framework. In other words it contains classes, objects, interfaces and inheritance.
Visual Studio .NET includes enormous enhancements over its predecessor Visual Studio ranging from a completely refurbished Visual Basic.NET(VB.NET) to the introduction of a new language Visual C#.NET.

C#(C-Sharp) is a new language which is derived from C and C++. Some of the features include:
- It is simpler as No Pointers. Unsafe operations are not allowed. No usage of “::” or “->” operators.
- “==“ is used for comparison, while”=” is used for assignments.
- Web Service Support – Turn any component into a web service
- Interoperable, Utilises all the benefits of the CLR. Support for COM.
- Objected Orientated – Supports Data encapsulation, inheritance, polymorphism and interfaces.
- Type Safe – Unsafe typecasts are not allowed. Primitive types are initialised to zeros and objects are initialised to null automatically.

First C# program
Type the following into a text editor (e.g. notepad), and save it with a .cs extension. (e.g. firstprogram.cs);
using System;
namespace MyNamespace
{
  class MyCsharpClass
{
  static void Main()
 {
   Console.WriteLine ("This is my first C# Program!");
   Console.ReadLine();
  }
}
}

You can compile above program by simply running the C# command line compiler(i.e. CSC.Exe)
CSC First.cs
Then you can execute the firstprogram.exe by typing firstprogram at the command prompt

Comments

Popular posts from this blog

Robot

Robot is drawn from an old Church Slavonic word, robota, for “servitude,” “forced labor” or “drudgery.” The word, which also has cognates in German, Russian, Polish and Czech, was a product of the central European system of serfdom by which a tenant’s rent was paid for in forced labor or service. The word robot was coined by artist Josef Čapek, the brother of famed Czechoslovakian author Karel Čapek. As a word, robot is a relative newcomer to the English language. It was the brainchild of a brilliant Czech playwright, novelist and journalist named Karel Čapek (1880-1938) who introduced it in his 1920 hit play, R.U.R., or Rossum’s Universal Robots. The robots in this play were not what we would call robots today, and they weren’t made of steel, plastic, and lines of code. Those robots were manufactured as pseudo-organic components out of a substance that acted like protoplasm in a factory, then “assembled” into humanoids. Watch video --> Saudi Arabia grants citizenship to huma...

The 120 year old light bulb that never been turned off.

Light bulb that never been turned off since 1901. ivermore's Centennial Light Bulb The Centennial Light is the world's longest-lasting light bulb, burning since 1901 , and almost never switched off. Due to its longevity, the bulb has been noted by The Guinness Book of World Records , Ripley's Believe It or Not!, and General Electric.  The Centennial Light was originally a 30-watt(or 60-watt) bulb, but is now very dim, emitting about the same light as a 4-watt nightlight. The hand-blown, carbon-filament common light bulb was manufactured in Shelby, Ohio, by the Shelby Electric Company in the late 1890s and was invented by Adolphe A. Chaillet. The hand-blown, carbon-filament common light bulb was invented by Adolphe Chaillet, a French engineer who filed a patent for this technology. It was manufactured in Shelby, Ohio, by the Shelby Electric Company in the late 1890s; many just like it still exist and can be found functioning. According to Zylpha Bernal Beck, the bulb was...

Wireless power transfer

Wireless power transfer Inventor and engineer Nikola Tesla, 'the man who invented the 20th century' theorized about wireless electricity back in the 1890s. He even demonstrated the principle by lighting up glass tubes with wireless power transmission. Nikola Tesla wanted to create the way to supply power without stringing wires. He almost accomplished his goal when his experiment led him to creation of the Tesla coil. It was the first system that could wirelessly transmit electricity. Wireless power transfer (WPT), wireless power transmission, wireless energy transmission (WET), or electromagnetic power transfer is the transmission of electrical energy without wires as a physical link. Wireless power transfer (WPT) is one of the hottest topics being actively studied, and it is being widely commercialized. In particular, there has been a rapid expansion of WPT in mobile phone chargers, stationary charging electric vehicles (EVs), and dynamic charging EVs, also called road-po...