Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts

Sunday, 25 May 2014

C# and JAVA

C# and JAVA are the programming languages that have a common root and this root is C++.
Moreover C# was developed by Microsoft as an alternative to JAVA for web based programming.


 Differences between C# and JAVA
1.       C# has more primitive data types than Java.
2.       Arrays are declared differently in C#.
3.       Unlike Java , all C# data types are objects.
4.       C# supports struct type and Java does not.
5.       C# provides static constructors for initialization.
6.       Java does not directly support enumerations.
7.       Java does not have any equivalent to indexers.
8.       Catch blocks should be ordered correctly in Java.
9.       There is no labeled break statement in C# . The goto is used to achieve this.
10. C# supports another iterative statement foreach along with the three(for , while and do while).    

Saturday, 24 May 2014

differences between C# and C++


1.   C# does not include header files and this is due to the reason that C# does not separate class definition from implementation.
2.   Class definition in C# does not end with semicolon.
3.   The first character of Main function in C# is capitalized.
The Main function must return either an int or void type value.
4.   Any uninitialized variable in C# is checked and an error message is displayed at compile time. In C++ any uninitialized variable remains undetected and later on causes unwanted output .
5.   C# permits declaration of variables between goto and label.
6.   Arrays differ in many aspects and behavior in C# as compared to C++.
7.   C# supports four iteration statements as compared to three of C++ . The fourth one included is foreach.
8.   The number of operators that can be overloaded in C# are less as compared to C++.
9.   C# does not provide any default for constructors.
10.                     In C# switch can be used on string values
11.                     Casting operations in C# are much safer than they are in C++.

12.                     Introduction of a keyword override. It is used while overriding a virtual function.