1.

C# vs Java

Answer»

C# and Java are both general purpose programming languages. There are a lot of similarities as well as differences between these TWO languages and so choosing the correct LANGUAGE depends on the programmer’s need.

Differences between C# and Java

Some of the differences between C# are Java are GIVEN as follows:

  1. C# is a part of the Microsoft .NET framework and is used to develop for Microsoft platforms. Java is designed by Sun Microsystems and is widely used in open-source projects.
  2. C# uses type safe METHOD pointers known as delegates that are used to implement event handling. Java does not contain the concept of delegates.
  3. Generics are implemented in the CLI in C# and the type information is available at runtime. Java implements generics using erasures.
  4. Common Language Runtime is used in C# while Java uses Java Virtual Machine.
  5. The enum is a list of NAMED constants in C#. In Java, enum is the named instance of a type.
  6. The concept of class properties is only used in C# and is not supported in Java.
  7. The switch operator in C# supports string as well as constant types. On the other hand, the switch operator in Java refers to the integral or enumerated type.
  8. Operator overloading is supported in C# while it is is not supported in Java.
  9. Polymorphism is implemented in C# by using the virtual and override keywords in base class and derived class. Java implements polymorphism by default.


Discussion

No Comment Found