Lect 2.2 Introduction to Csharp

Lect 2.2 Introduction to Csharp - Lecture 2.2 Introduction...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture 2.2 Introduction to C# MAIN TOPICS: .NET Framework and C# Programming Language C# and Java Similarities C# Translation and Execution C# Basic Features Predefined data types, value and reference types, boxing and unboxing, parameter passing, I/O stream, namespace References: Deitel et al., C# How to Program , Prentice Hall, 2002
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Introduction to C# 2 Topics .NET Framework and C# Programming Language C# and Java Similarities C# Translation and Execution C# Basic Features Predefined data types, value and reference types, boxing and unboxing, parameter passing, I/O stream, namespace
Background image of page 2
Introduction to C# 3 .NET Framework Introduced by Microsoft (June 2000) Vision for embracing the Internet in software development Independence from a specific language or platform Includes Framework Class Library (FCL) for reuse Executes programs by Common Language Runtime (CLR) Programs compiled to Microsoft Intermediate Language (MSIL) MSIL code translated into machine code Visual Basic .NET, Visual C++ .NET, C# and more
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Introduction to C# 4 C# Programming Language Developed at Microsoft Event-driven, object-oriented Based on C, C++ and Java I ntegrated D esign E nvironment (IDE) Makes programming and debugging fast and easy R apid A pplication D evelopment (RAD) Incorporated into .NET platform Web based applications can be distributed Programs that can be accessed by anyone through any device Allows communicating with different computer languages
Background image of page 4
Introduction to C# 5 C# and Java Similarities Single rooted class hierarchy All C# classes are subclasses of System.Object All Java classes are subclasses of java.lang.Object Compiles into machine-independent code (plus, in C#, language-independent) code which runs in a managed execution environment Java Æ Java byte code Æ machine code (executed by Java Virtual Machine (JVM) ) C# Æ Intermediate Language (IL) Æ Machine Code (executed by Common Language Runtime (CLR) ) Classes are allocated on the heap with the new keyword Garbage collection coupled with the elimination of pointers
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Introduction to C# 6 C# and Java Similarities (cont’d) No Global Methods (unlike C++). Methods have to be part of a class either as member or static methods Supports the concept of an interface which is akin to a pure abstract class Allow only single inheritance of classes but multiple inheritance (or implementation) of interfaces Arrays can be jagged All values are initialized before use int [ ][ ]myArray = new int[2][ ]; myArray[0] = new int[3]; myArray[1] = new int[9];
Background image of page 6
Introduction to C# 7 C# and Java Similarities (cont’d) Unextendable Classes - a class should be the last one in an inheritance hierarchy and cannot be used as a base class C# Java The try block indicates guarded regions, the catch block handles thrown exceptions and the finally block releases resources before leaving the method
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/08/2010 for the course SCE CSC301 taught by Professor Mr.leong during the Fall '10 term at Nanyang Technological University.

Page1 / 31

Lect 2.2 Introduction to Csharp - Lecture 2.2 Introduction...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online