#4 – How is C# Different From Java?

C# and Java are both object-oriented languages that derive their syntax from C and run in a managed environment.  There are, however a number of differences.  Here are the main ones:

  • Syntactic differences, e.g. “class B extends A” instead of “class B : A”
  • Java doesn’t use namespaces
  • C# lock statement vs. Java synchronized statement
  • C# has a few more access modifiers than Java
  • In Java, enumerated types are full-fledged classes
  • C# allows strings in switch statements
  • C# programs make use of the .NET Framework; Java programs use the Java SE

Lots more at: C# From a Java Developer’s Perspective

About Sean
Software developer in the Twin Cities area, passionate about .NET technologies. Equally passionate about my own personal projects related to family history and preservation of family stories and photos.

One Response to #4 – How is C# Different From Java?

  1. Anup Verma says:

    Unlike Java, in C#:

    1. datatype decimal is present and there are more integer data types
    2. in switch: “break” is compulsory in all “cases” of the switch (with some exceptions)
    3. operator overloading is supported
    4. default access is private
    5. Unsigned Right Shift(>>>) Bitwise operator NOT present
    6. Implicitly typed variables can be used

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 43 other followers