Difference between Csharp and Java?

The following table shows the differences between 'Csharp' and 'Java'


Java

C#
1
"Java" is a trademark of Oracle (formerly Sun Microsystems )
"C#" is a trademark of Microsoft Company.
2
Java is influenced by C++

C# is enhanced version of C++
3
Java language is designed to run on Java Runtime Environment (JRE).

C sharp programming language is designed to run on Common Language Runtime (CLR)
4
Java is “Platform Independent”
C# is “Platform dependent”
5

There are plenty of IDEs for Java, both free (e.g. Eclipse, NetBeans) and commercial (e.g. IntelliJ IDEA)
But in C sharp only licensed version e.g. Microsoft Visual Studio
6
In Java the return type of main () method is void.

In C sharp the return type of main () method is void or int.

7
Java supports constructors only.

C sharp supports both constructors and destructors.

8
Java doesn’t support unsigned integers but support for signed integers.

C sharp supports unsigned integers as well as signed integers.

9
Java doesn’t support pointers.

C sharp support pointers.
10
Soft references: Yes

Soft references: No
11
Data Access Methods: public, package, protected, private

Data Access Methods: public, internal, protected, private, protected internal
12
No support for partial classes.

Support for partial classes.
13
Java doesn’t support for operator overloading.
C sharp supports for operator and conversion overloading.
14
Java supports package hierarchical structure that reflects the directory hierarchical structure.

Java supports namespace that do not reflect the directory hierarchical structure.

15
Java supports super keyword.
C sharp supports base keyword which is replaced by super keyword.
16
Java supports checked exceptions for better enforcement of error trapping and handling.
C sharp doesn’t support checked exceptions.
17
Java doesn’t include delegates.

C# includes delegates.
18
Java doesn’t include struct.

C# includes struct.
19
Standard output:
System.out.println(“Welcome   to java”);
Standard output:
Console.WriteLine(“Welcome to C sharp”);
20
Constant variables are declared using final keyword.
Constant variables are declared using const keyword.

21
In java, All methods are by default virtual and you can override them.
In C sharp, All methods are by default non - virtual and you can not override them.
22
Support for anonymous inner classes.

No support for anonymous inner classes.
23
Java has no preprocessor directives.

C sharp has preprocessor directives (#define, #if etc).
24
Multidimensional arrays only in the form of arrays of arrays (also known as "jagged" arrays); Java does not have true rectangular multidimensional arrays.
True multidimensional "rectangular" arrays, as well as arrays of arrays (jagged arrays).
25
Reflection cannot be used to construct new generic realizations.
Reflection can be used to create new realizations for new combinations of type parameters.
26
Static members are shared across all generic realizations.
Static members are separate for each generic realization.
27
Java doesn’t have expression tree.
C sharp have expression tree.
28
Java doesn't have LINQ
C sharp has LINQ(Language Integrated Query)
29
Java is proprietary, though largely controlled through an open community process.
C sharp is defined by ECMA and ISO standards.
30
Java API is managed through an open community process.
C sharp API is completely controlled by Microsoft.