Java and C# more or less match with each other.Java is influeced by C++ whereas C# is enhaced version of C++. C# derives from C/C++ with modernization and type safety- to adapt the changes in environment and to implement advances in the art of programming.
In Java the return type ofmain() is void whereas in C#, We are not restricted only to void we can also also have int.
In Java pointers does not exist and was not designed to be compatible with any other languge. Although the default for C# code is safe mode , we can declare classes or method to be unsage This enable us to use pointers , structs andstatically allocated arrays.Both the safe mode and unsafe code run in the managed space , which implies no marshalling is incurred when calling unsafe code from safe code.
In Java the main(), if there are no parameters required we still need to incle the command line parameters array. This is not the case with C# we can declare Main() as
public static void Main(){...}
Although Java supports constructors, it doesn't have destructors. Whereas in C# we have destructors to release all the expensive resources even though we have garbage collector, which does the same - isn't invoked immediately after the variable goes out of scope, but only at certain intervals or memory conditions.
In Java it is not possible to declare unsigned integers whereas in C# POS type system i.e., intended to support the complete implementation of a wide range of programming language makes us impossible to declare unsigned integers.