C# (C sharp) is an object-oriented, structured language, as part of .NET initiative
C# is based on C and C++, resembles Java.
Its case-sensitive, ends with ;, execution starts with main method, class name can be different from file name
Online tool
http://www.tutorialspoint.com/compile_csharp_online.php
C# source code file has extension .cs
IDE: Visual Studio (VS), Visual C# 2010 Express, Visual Web Developer
Compiling (Mono C# compiler)
mcs file.cs -out file.exe
Executing
mono file.exe
using is a keyword
namespace is a collection of classes
class has many methods behavior)
There is one main method.
--------------------------
using System.IO;
using System;
class Program
{
static void Main()
{
Console.WriteLine("Hello, World!");
}
}
Hello, World!
---------
using System;
namespace HelloWorldApplication
{
class HelloWorld
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World");
Console.ReadKey();
}
}
}
Hello, World
--------------------------
C# is based on C and C++, resembles Java.
Its case-sensitive, ends with ;, execution starts with main method, class name can be different from file name
Online tool
http://www.tutorialspoint.com/compile_csharp_online.php
C# source code file has extension .cs
IDE: Visual Studio (VS), Visual C# 2010 Express, Visual Web Developer
Compiling (Mono C# compiler)
mcs file.cs -out file.exe
Executing
mono file.exe
using is a keyword
namespace is a collection of classes
class has many methods behavior)
There is one main method.
--------------------------
using System.IO;
using System;
class Program
{
static void Main()
{
Console.WriteLine("Hello, World!");
}
}
Hello, World!
---------
using System;
namespace HelloWorldApplication
{
class HelloWorld
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World");
Console.ReadKey();
}
}
}
Hello, World
--------------------------
No comments:
Post a Comment