Presentation is loading. Please wait.

Presentation is loading. Please wait.

C# Versus Java Author: Eaddy, Marc Source: Software Tools for the Professional Programmer. Dr. Dobb's Journal. Feb2001, Vol. 26 Issue 2, p74 Hong Lu CS699A.

Similar presentations


Presentation on theme: "C# Versus Java Author: Eaddy, Marc Source: Software Tools for the Professional Programmer. Dr. Dobb's Journal. Feb2001, Vol. 26 Issue 2, p74 Hong Lu CS699A."— Presentation transcript:

1 C# Versus Java Author: Eaddy, Marc Source: Software Tools for the Professional Programmer. Dr. Dobb's Journal. Feb2001, Vol. 26 Issue 2, p74 Hong Lu CS699A Professional Seminar, Rivier College September 19, 2001

2 Java & C# Java: Sun Microsystems, “it is a relatively fast, small, and reliable language that is hardware neutral.” C#: Microsoft, “simple, modern, object- oriented, and type-safe programming language derived from C and C++.”

3 Hello World! HelloWorld.java class HelloWorld’ { public static void main(String[] args) { System.out.println(“Hello, World”); } HelloWorld.cs class HelloWorld { public static void main(string[] args) { System.Console.WriteLine(“Hello,world”); }

4 Common Features of Java & C# Automatic garbage collection. Reflection for type information discovery. Source code is compiled to an intermediate bytecode. Just-in-Time (JIT) compilation compiles bytecode into native code. Everything must be in a class--no global functions or data. No multiple inheritance, although you can implement multiple interfaces. All classes derive from Object. Security for restricting access to resources.

5 Common Features of Java & C# Exceptions for error handling. Packages/namespaces for preventing type collision. Code comments as documentation. Arrays are bounds checked. GUI, networking, and threading support. No uninitialized variables. No pointers. No header files.

6 C# Improvements Over Java Reflection, Metadata, and Custom Attributes Versioning Assertions Ref and out Parameters Virtual Methods enums decimal Data Types switch Statements C# Syntactic Sugar C# Performance Improvements


Download ppt "C# Versus Java Author: Eaddy, Marc Source: Software Tools for the Professional Programmer. Dr. Dobb's Journal. Feb2001, Vol. 26 Issue 2, p74 Hong Lu CS699A."

Similar presentations


Ads by Google