1 / 20

Introduction to C#

Introduction to C#. Tuc Goodwin. Agenda. Upcoming Schedule Syntax Differences Exiting programs/methods/loops Member Scope Conditional Statements Indexes and Arrays Control Characters Loops Inheritance Overloading Summary. Upcoming Schedule . Intro to C# (November)

kalil
Download Presentation

Introduction to C#

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to C# Tuc Goodwin

  2. Agenda • Upcoming Schedule • Syntax Differences • Exiting programs/methods/loops • Member Scope • Conditional Statements • Indexes and Arrays • Control Characters • Loops • Inheritance • Overloading • Summary

  3. Upcoming Schedule • Intro to C# (November) • Debugging .NET 2.0 (December) • Serializations (January) • Object Thinking (February) • ADO.NET Revisited (March) Let’s look at some code!

  4. Syntax Differences • Case Sensitivity • Line Termination • Comments • Namespace Declaration and Usage • Variable Declaration • Variable Initialization • Declaring Function Parameters

  5. Exiting Programs/Methods/Loops • VB.Net – End • VB/C# - System.Environment.Exit(1) • VB.Net – Exit For / Exit Function • C# - break; • C# - continue;

  6. Member Scope

  7. C# vs. VB.Net • Static vs. Shared • static in C# • Shared in VB.Net • Classes vs. Modules • class • Module

  8. Conditional Statement • VB.Net – If <condition> Then : Else : End If • C# - if( <condition>) { } else { }

  9. Operators || Short Circuiting if (DoTask() || DoTask2()) { } If DoTask() or DoTask2() Then…

  10. Ternary Operators • Visual Basic Immediate IFIIF(true/false), value for true, value for false • C# - (true/false clause)? Value for true: value for false;

  11. Indexes and Arrays • Indexes • VB.Net use parenthesis (n) • C# use brackets [n] • Arrays • string[] phones = {“1”,”2”,”3”}; • phones = new string[3];

  12. Loops • for(int count=1, count < 20; count++){} • for( string count=“”, count !=“done”;){} • string[] names = new string[5];foreach(string onename in names){…}

  13. Control Characters

  14. Type Comparison • VB.Net – Ctype() GetType() • C# - typeof()

  15. Object Oriented - Inheritance • Class Checking : Account{…} • Class Checking Inherits Account…End Class

  16. Object Oriented - Overloading • public void MakeDeposit(int Amount){} • public void MakeDeposit(ref int Amount, intAmountAvailable){} • Sub MakeDeposit (ByVal Amount as Integer)End Sub • Sub MakeDeposit (ByVal Amount as Integer, AmountAvailable as Integer)End Sub

  17. Summary • We…

  18. Other Resources • www.microsoft.com/net • msdn.microsoft.com/net • www.gotdotnet.com • support.microsoft.com/webcasts • www.dnug.net • www.devx.com/dotnet/ • www.thedotnetmag.com • www.winnetmag.com • www.microsoft.com/mspress

  19. Next Time… We will continue to build from here… Debugging .NET 2.0

  20. Questions?

More Related