C# and java was derived from c++ therefore they have similar
roots.C# has borrowed some features from java. However, there exist a numbers
of differences between c# and Java.
Java
|
C#
|
Java uses Static final to
declare a class constant
|
C# uses CONST
|
Java does not support struct
type
|
Its support struct type
|
Java does not support operator overloading
|
Its support operator overloading
|
Class members are virtual by default and a method name in a derived
class overrides the base class member
|
In C# the base member is required to have the virtual keyword and the derived member is required to use the override keyword
|
In java parameters are always passed by value
|
It allows parameters to be passed by reference by using ref keyword
|
In java switch statement can have only integer expression
|
C# support either an integer or string expression
|
Java uses instanceof
operator instead of is operator in C#
|
C# uses is operator
instead of instanceof operator in
java
|
In java ,all c# data types are objects
|
C# has more primitive data
types
|
Java does not support directly on enumerations
|
C# supports enumerations
|
|
|
0 comments:
Post a Comment