Dosomething rdispose is called statements checked

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ispose() is called Statements checked and unchecked Statements The checked and unchecked statements allow you to control overflow checking for integral-type arithmetic operations and conversions checked forces checking unchecked forces no checking Can use both as block statements or as an expression Default is unchecked Use the /checked compiler option to make checked the default Statements Basic Input/Output Statements Console applications System.Console.WriteLine(); System.Console.ReadLine(); Windows applications System.Windows.Forms.MessageBox.Show(“Hello”); string v1 = “some value”; MyObject v2 = new MyObject(); Console.WriteLine(“First is {0}, second is {1}”, v1, v2); Outline Hello World Design Goals of C# Types Program Structure Statements Operators Using Visual Studio Using the .NET Framework SDK Operators Overview C# provides a fixed set of operators, whose meaning is defined for the predefined types Some operators can be overloaded (e.g. +) The following table summarizes the C# operators by category Categories are in order of decreasing precedence Operators in each category have the same precedence Operators Precedence Category Primary Operators Grouping: (x) Member access: x.y Method call: f(x) Indexing: a[x] Post-increment: x++ Post-decrement: x— Constructor call: new Type retrieval: typeof Arithmetic check on: checked Arithmetic check off: unchecked Operators Precedence Category Operators Unary Positive value of: + Negative value of: Not: ! Bitwise complement: ~ Pre-increment: ++x Post-decrement: --x Type cast: (T)x Multiplicative Multiply: * Divide: / Division remainder: % Operators Precedence Category Additive Shift Relational Operators Add: + Subtract: Shift bits left: << Shift bits right: >> Less than: < Greater than: > Less than or equal to: <= Greater than or equal to: >= Type equality/compatibility: is Type conversion: as Operators Precedence Category Equality Operators Equals: == Not equals: != Bitwise AND & Bitwise XOR ^ Bitwise OR | Logical AND && Logical OR || Operators Precedence Category Ternary conditional Assignment Operators ?: =, *=, /=, %=, +=, -=, <<=, >>=, &=, ^=, |= Operators Associativity Assignment and ternary conditional operators are right-associative Operations performed right to left x = y = z evaluates as x = (y = z) All other binary operators are left-associative Operations performed left to right x + y + z evaluates as (x + y) + z Use parentheses to control order Outline Hello World Design Goals of C# Types Program Structure Statements Operators Using Visual Studio Using the .NET Framework SDK Using Visual Studio Types of projects Console Application Windows Application Web Application Web Service Windows Service Class Library ... Using Visual Studio Windows Solution Explorer Class View Properties Output Task List Object Browser Server Explorer Toolbox Using Visual Studio Building Debugging Break points References Saving Outline Hello World Design Goals of C# Types Program Structure Statements Operators Using Visual Studio.NET Using the .NET Framework SDK Using .NET Framework SDK Compiling from command line csc /r:System.WinForms.dll class1.cs file1.cs...
View Full Document

Ask a homework question - tutors are online