BY BOWYA G.  This International Standard is based on a submission from Hewlett-Packard, Intel, and Microsoft, that describes a language called C#. 

Slides:



Advertisements
Similar presentations
Lecture 5: Interfaces.
Advertisements

C# Language Report By Trevor Adams. Language History Developed by Microsoft Developed by Microsoft Principal Software Architect Principal Software Architect.
INHERITANCE BASICS Reusability is achieved by INHERITANCE
ITF11006.NET Inheritance. Classes and Inheritance Constructors and Inheritance Modifiers Interfaces Operators.
CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics C# Language &.NET Platform 4 th Lecture Pavel Ježek
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
C# Structs, operator overloading & attributes. Structs ~ Structures Structs are similar to classes: they represent data structures with data and functions.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
C#.NET C# language. C# A modern, general-purpose object-oriented language Part of the.NET family of languages ECMA standard Based on C and C++
OOP in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 20 Microsoft’s Approach 3 – C# Rob Pooley
From C++ to C#. Web programming The course is on web programming using ASP.Net and C# The course is on web programming using ASP.Net and C# ASP.Net is.
Differences between C# and C++ Dr. Catherine Stringfellow Dr. Stewart Carpenter.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
Effective C# 50 Specific Way to Improve Your C# Item 50 Scott68.Chang.
Overview of Previous Lesson(s) Over View  OOP  A class is a data type that you define to suit customized application requirements.  A class can be.
Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.
BIM313 – Advanced Programming Techniques Object-Oriented Programming 1.
Visual Programming Fall 2012 – FUUAST Topic: Development environment.
Distributed Systems (236351) Tutorial 1 - Getting Started with Visual Studio C#.NET.
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
C#C# Introduction CS3260 Dennis A. Fairclough Version 1.0 Introduction CS3260 Dennis A. Fairclough Version 1.0.
2: Everything is an Object You Manipulate Objects Using References Primitives Arrays in Java Scoping You Never Destroy Objects Creating New Data Types:
Tuc Goodwin  Object and Component-Oriented Programming  Classes in C#  Scope and Accessibility  Methods and Properties  Nested.
ILM Proprietary and Confidential -
CIS 3301 C# Lesson 7 Introduction to Classes. CIS 3302 Objectives Implement Constructors. Know the difference between instance and static members. Understand.
1 Chapter 8 – Classes and Object: A Deeper Look Outline 1 Introduction 2 Implementing a Time Abstract Data Type with a Class 3 Class Scope 4 Controlling.
C# Language Panithan Chandrapatya Agenda C# History C# Goals C# Fixes C# Contribution C# Features C# Success C# Example.
C# EMILEE KING. HISTORY OF C# In the late 1990’s Microsoft recognized the need to be able to develop applications that can run on multiple operating system.
Session 04 Module 8: Abstract classes and Interface Module 9: Properties and Indexers.
C# Classes and Inheritance CNS 3260 C#.NET Software Development.
1 Interfaces and Abstract Classes Chapter Objectives You will be able to: Write Interface definitions and class definitions that implement them.
Introduction to Java Chapter 7 - Classes & Object-oriented Programming1 Chapter 7 Classes and Object-Oriented Programming.
Inheritance. Inheritance - Introduction Idea behind is to create new classes that are built on existing classes – you reuse the methods and fields and.
1 9/6/05CS360 Windows Programming CS360 Windows Programming.
CIS 270—Application Development II Chapter 8—Classes and Objects: A Deeper Look.
PROGRAMMING IN C#. Collection Classes (C# Programming Guide) The.NET Framework provides specialized classes for data storage and retrieval. These classes.
Lecture 8: Object Oriented Programming. What is a Programming Object? An object is an instance of a class. A class is a template for an object. Everything's.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
Introduction to Object-Oriented Programming Lesson 2.
Object Oriented Software Development 4. C# data types, objects and references.
Interfaces An interface is like an extreme case of an abstract class – However, an interface is not a class – It is a type that can be satisfied by any.
CNS 3260 C# .NET Software Development
Classes, Interfaces and Packages
Introduction to C# By: Abir Ghattas Michel Barakat.
21. PHP Classes To define a class, use the keyword class followed by the name and a block with the properties and method definitions Properties are declared.
CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics C# Language &.NET Platform 4 th Lecture Pavel Ježek
1 C# - Inheritance and Polymorphism. 2 1.Inheritance 2.Implementing Inheritance in C# 3.Constructor calls in Inheritance 4.Protected Access Modifier 5.The.
1 Chapter 15-1 Pointers, Dynamic Data, and Reference Types Dale/Weems.
C# Fundamentals An Introduction. Before we begin How to get started writing C# – Quick tour of the dev. Environment – The current C# version is 5.0 –
Unit 2. Constructors It initializes an object when it is created. It has same as its class and syntactically similar to a method. Constructor have no.
Value Types. 2 Objectives Discuss concept of value types –efficiency –memory management –value semantics –boxing –unboxing –simple types Introduce struct.
Object Based Programming Chapter 8. 2 Contrast ____________________ Languages –Action oriented –Concentrate on writing ________________ –Data supports.
C# for C++ Programmers 1.
Creating and Using Objects, Exceptions, Strings
C# - OOP TTU IT College , Autumn SEMESTER Andres käver.
Jim Fawcett CSE681 – SW Modeling & Analysis Fall 2014
Static data members Constructors and Destructors
2.7 Inheritance Types of inheritance
Module 5: Common Type System
Microsoft .NET 3. Language Innovations Pan Wuming 2017.
Structs.
CS360 Windows Programming
DATA HANDLING.
Simple Classes in C# CSCI 293 September 12, 2005.
Pointers C#, pointers can only be declared to hold the memory addresses of value types int i = 5; int *p; p = &i; *p = 10; // changes the value of i to.
Assessment – Java Basics: Part 1
CMSC 202 Interfaces.
5. 3 Coding with Denotations
String Class.
Presentation transcript:

BY BOWYA G

 This International Standard is based on a submission from Hewlett-Packard, Intel, and Microsoft, that describes a language called C#.  It was developed within Microsoft.  The first widely distributed implementation of C# was released by Microsoft in July 2000, as part of its.NET Framework initiative.  Its runs with Common Language Infrastructure

 The language is intended for use in developing software components suitable for deployment in distributed environments.  C# is intended to be a simple, modern, general- purpose, object-oriented programming language.  Support for internationalization is very important.  This programmers already familiar with C and C++.

 C# is intended to be suitable for writing applications for both hosted and embedded systems.  Although C# applications are intended to be economical with regards to memory and processing power requirements, the language was not intended to compete directly on performance and size with C or assembly language.  The development of this standard started in November 2000.

 C# supports two kinds of types: value types and reference types.  Value types include simple types (e.g.,char, int, and float), enum types, and struct types.  Reference types include class types, interface types,delegate types, and array types.

 Value types differ from reference types in that variables of the value types directly contain their data, whereas variables of the reference types store references to objects.  The reference types, it is possible fortwo variables to reference the same object, and thus possible for operations on one variable to affect the object referenced by the other variable. With

using System; class Class1 { public int Value = 0; } class Test { static void Main() { int val1 = 0; int val2 = val1; val2 = 123; Class1 ref1 = new Class1();

Class1 ref2 = ref1; ref2.Value = 123; Console.WriteLine("Values: {0}, {1}", val1, val2); Console.WriteLine("Refs: {0}, {1}", ref1.Value, ref2.Value); } Output:  Values: 0, 123  Refs: 123, 123

TypeDescriptionExample stringString typestring s = "hello"; sbyte8-bit signed typesbyte val = 12; short16-bit signed typeshort val = 12; byte8-bit signed typebyte val1 = 12; ushort16-bit signed typeushort val1 = 12; int32-bit signed typeint val = 12; Long64-bit signed typeLong val=122; floatSingle-precision floating point type float val = 1.23F; doubledouble Double- precision floating point type double val1 = 1.23; double val2 = 4.56D;

 Arrays may be single-dimensional or multi- dimensional. Both.rectangular. and.jagged. arrays are supported.  Jagged array is important concept in c#.  creates a single-dimensional array of int values, initializes the array elements, and then prints each of them out. Ex : int[] arr = new int[5];

using System; class Test { static void Main() { int[] arr = new int[5]; for (int i = 0; i < arr.Length; i++) arr[i] = i * i; for (int i = 0; i < arr.Length; i++) Console.WriteLine("arr[{0}] = {1}", i, arr[i]); }

Output : arr[0] = 0 arr[1] = 1 arr[2] = 4 arr[3] = 9 arr[4] = 16 here int[] used in the previous example is an array type.

 Class members can include constants, fields, methods, properties, events, indexers, operators, instance constructors, destructors, static constructors, and nested type declarations.  Class declarations define new reference types. A class can inherit from another class, and can implement interfaces.

FormMeaning publicAccess not limited protectedAccess limited to the containing class or types derived from the containing class internalAccess limited to this program privateAccess limited to the containing type

 A destructor is a member that implements the actions required to destruct an instance of a class.  Destructors cannot have parameters, they cannot have accessibility modifiers, and they cannot be called explicitly.  The destructor for an instance is called automatically during garbage collection.

using System; class Point { public double x, y; public Point(double x, double y) { this.x = x; this.y = y; } ~Point() { Console.WriteLine("Destructed {0}", this); } public override string ToString() { return string.Format("({0}, {1})", x, y); }

 A static constructor is a member that implements the actions required to initialize a class.  Static constructors cannot have parameters, they cannot have accessibility modifiers, and they cannot be called explicitly  The static constructor for a class is called automatically.

using Personnel.Data; class Employee { private static DataSet ds; static Employee() { ds = new DataSet(.); } public string Name; public decimal Salary;. }