C#
C# Author: Anders Hejlsberg
By the help of C# programming language, we can develop different types of secured and robust applications:
- Window applications
- Web applications
- Distributed applications
- Web service applications
- Database applications etc.
Features Of C#
(1) Simple
- C# is a simple language in the sense that it provides structured approach (to break the problem into parts), rich set of library functions, data types etc.
- C# is a simple language in the sense that it provides structured approach (to break the problem into parts), rich set of library functions, data types etc.
(2) Modern Programming Language
- C# programming is based upon the current trend and it is very powerful and simple for building scalable, interoperable and robust applications.
- C# programming is based upon the current trend and it is very powerful and simple for building scalable, interoperable and robust applications.
(3) Object Oriented
C# is object oriented programming language. OOPs makes development and maintenance easier where as in Procedure-oriented programming language it is not easy to manage if code grows as project size grow.
(4) Type Safe
C# type safe code can only access the memory location that it has permission to execute. Therefore it improves a security of the program.
(5) Interoperability
- Interoperability process enables the C# programs to do almost anything that a native C++ application can do.
- Interoperability process enables the C# programs to do almost anything that a native C++ application can do.
(6) Scalable And Updateable
- C# is automatic scalable and updateable programming language. For updating our application we delete the old files and update them with new ones.
- C# is automatic scalable and updateable programming language. For updating our application we delete the old files and update them with new ones.
(7) Structured Programming Language
- C# is a structured programming language in the sense that we can break the program into parts using functions. So, it is easy to understand and modify.
- C# is a structured programming language in the sense that we can break the program into parts using functions. So, it is easy to understand and modify.
(8) Rich Library
- C# provides a lot of inbuilt functions that makes the development fast.
- C# provides a lot of inbuilt functions that makes the development fast.
(9) Fast Speed
- The compilation and execution time of C# language is fast.
- The compilation and execution time of C# language is fast.
Example of C# program
public class OperatorExample
{
public static void main(String args[])
{
int x=10;
System.out.println(x++);//10 (11)
System.out.println(++x);//12
System.out.println(x--);//12 (11)
System.out.println(--x);//10
}
}
Class : is a keyword which is used to define class.
Program: is the class name. A class is a blueprint or template from which objects are created. It can have data members and methods. Here, it has only Main method.
static: is a keyword which means object is not required to access static members. So it saves memory.
void: is the return type of the method. It does't return any value. In such case, return statement is not required.
Main: is the method name. It is the entry point for any C# program. Whenever we run the C# program, Main() method is invoked first before any other method. It represents start up of the program.
string[] args: is used for command line arguments in C#. While running the C# program, we can pass values. These values are known as arguments which we can use in the program.
System.Console.WriteLine("Hello World!"): Here, System is the namespace. Console is the class defined in System namespace. The WriteLine() is the static method of Console class which is used to write the text on the console.
public class OperatorExample
{
public static void main(String args[])
{
int x=10;
System.out.println(x++);//10 (11)
System.out.println(++x);//12
System.out.println(x--);//12 (11)
System.out.println(--x);//10
}
}
Class : is a keyword which is used to define class.
Program: is the class name. A class is a blueprint or template from which objects are created. It can have data members and methods. Here, it has only Main method.
static: is a keyword which means object is not required to access static members. So it saves memory.
void: is the return type of the method. It does't return any value. In such case, return statement is not required.
Main: is the method name. It is the entry point for any C# program. Whenever we run the C# program, Main() method is invoked first before any other method. It represents start up of the program.
string[] args: is used for command line arguments in C#. While running the C# program, we can pass values. These values are known as arguments which we can use in the program.
System.Console.WriteLine("Hello World!"): Here, System is the namespace. Console is the class defined in System namespace. The WriteLine() is the static method of Console class which is used to write the text on the console.
Comments
Post a Comment