|
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: - 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.
- C# uses type safe METHOD pointers known as delegates that are used to implement event handling. Java does not contain the concept of delegates.
- Generics are implemented in the CLI in C# and the type information is available at runtime. Java implements generics using erasures.
- Common Language Runtime is used in C# while Java uses Java Virtual Machine.
- The enum is a list of NAMED constants in C#. In Java, enum is the named instance of a type.
- The concept of class properties is only used in C# and is not supported in Java.
- 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.
- Operator overloading is supported in C# while it is is not supported in Java.
- Polymorphism is implemented in C# by using the virtual and override keywords in base class and derived class. Java implements polymorphism by default.
|