... Names 23 1 A .2. 2 Types 23 1 A .2. 3 Variables 23 2 A .2. 4 Expressions 23 2 A .2. 5 Statements 23 3 A .2. 6 Namespaces 23 5 A .2. 7 Classes 23 5 A .2. 8 Structs 23 7 A .2. 9 Arrays 23 7 A .2. 10 Interfaces 23 7 A .2. 11 ... 56 4 .2 Value Types 56 4 .2. 1 Simple Value Types 57 4 .2. 2 Nullable Types 58 4 .2. 3 Structure Types 60 4 .2. 4 Enumeration Types 61 4. 3 Lit...
Ngày tải lên: 05/08/2014, 10:20
... value; } 20 Chapter 2: Classes, Objects, and Namespaces ■ 20 Console.WriteLine( id.GetLastName()+ 21 NameSeparator+id.GetFirstName() ); 22 } 23 } 24 } To produce an executable program in C#, one ... System; class Format { static void Main() { Console.WriteLine("|{0:C}|{1:C}|", 1 .23 , -1 .23 ); Console.WriteLine("|{0:D}|{1:D4}|", 123 , - 123 ); Console.WriteLine(&...
Ngày tải lên: 05/08/2014, 10:20
Praise for C# 2.0: Practical Guide for Programmers 2005 phần 3 docx
... signed 0 - 327 68 327 67 ushort 16-bit unsigned 0 0 65535 int 32- bit signed 0 -21 47 483 648 21 47 483 647 uint 32- bit unsigned 0 0 42 9 49 6 729 5 long 64- bit signed 0 - 922 33 720 368 547 75808 922 33 720 368 547 75807 ulong ... 25 5); Console.WriteLine("| {0:# .00}|{1:0.00}| {2, 5:0.00}|{3,-5:0.00}|", .23 , .23 , .23 , .23 ); } } Output: |$1 .23 |($1 .23 )| | 123 |-0 12...
Ngày tải lên: 05/08/2014, 10:20
Praise for C# 2.0: Practical Guide for Programmers 2005 phần 4 pdf
... sc1.ToString()); 44 Console.WriteLine("sc2.ToString = {0}", sc2.ToString()); 45 46 DeepCopy dc1 = new DeepCopy(v2); 47 DeepCopy dc2 = (DeepCopy)dc1.Clone(); 48 v2.Inc(); 49 50 Console.WriteLine("dc1.ToString ... character array. 72 Chapter 4: Unified Type System ■ 24 } 25 public override int GetHashCode() { 26 return name.GetHashCode() ˆ count; // Exclusive or. 27...
Ngày tải lên: 05/08/2014, 10:20
Praise for C# 2.0: Practical Guide for Programmers 2005 phần 5 pptx
... //1+3 =4 a=1; System.Console.WriteLine("{0} ", ++a + a++); //3+1 =4 } } Output: 323 44 4 5.11 .2 Explicit Casts C# is a strongly typed language and therefore checks for type compatibility at compile- time. As seen ... ); System.Console.WriteLine("{0:x}({1})", (-a << 2) , (-a << 2) ); } } Output: f fffffffe( -2) ffffffe8( - 24 ) 5.10 Arithmetic Opera...
Ngày tải lên: 05/08/2014, 10:20
Praise for C# 2.0: Practical Guide for Programmers 2005 phần 6 pot
... [{0}]", e); 128 Chapter 6: Statements and Exceptions ■ Enter a number: -1 Overflow: Value was either too large or too small for a UInt 32. Enter a number: 7 126 3 54 127 35 42 7 345 127 3 64 527 43 65 127 4 Overflow: ... IntView(View.AsHexa); 20 c = new IntView(View.AsChar); 21 22 System.Console.Write("\ni: "); i( 32) ; 23 System.Console.Write("\nx: "); x...
Ngày tải lên: 05/08/2014, 10:20
Praise for C# 2.0: Practical Guide for Programmers 2005 phần 7 ppt
... 00:0 1 00: 02 00:0 3 00:0 4 00:0 5 00:0 6 00:0 7 00:0 8 00:0 9 00:1 0 00:1 1 00: 12 00:1 3 00:1 4 00:1 5 00:1 6 00:1 7 00:1 8 00:1 9 00 :20 00 :21 00 :22 00 :23 00 : 24 00 :25 00 :26 00 :27 00 :28 00 :29 00:3 0 00:3 1 00: 32 00:3 3 ... 00: 32 00:3 3 00:3 4 00:3 5 00:3 6 00:3 7 00:3 8 00:3 9 00 :4 0 00 :4 1 00: 42 00 :4 3 00 :4 4 00 :4 5 00 :4 6 00 :4 7 00 :4 8 00 :4 9 00:5...
Ngày tải lên: 05/08/2014, 10:20
Praise for C# 2.0: Practical Guide for Programmers 2005 phần 8 pot
... ); 39 40 Print("h1", h1); 41 Print("s1", s1); 42 Print("s2", s2); 43 Print("h2", h2); 44 h2.Add("Be", "Be Sharp"); 45 Print("h2", ... list[index]; } 20 } 21 public bool MoveNext() { 22 return ++index < list.Length; 23 } 24 public void Reset() { 25 index = -1; 26 } 27 private int[] list; 28 private int in...
Ngày tải lên: 05/08/2014, 10:20
Praise for C# 2.0: Practical Guide for Programmers 2005 phần 9 docx
... done. 1111111111111111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111 122 222 222 222 222 222 222 222 222 222 222 222 222 222 222 2 22 222 222 222 222 222 222 222 222 222 222 222 222 222 222 222 222 222 222 222 222 222 222 222 222 22 222 222 222 222 222 222 222 222 222 222 2111111111111111111111111111111111111111111111 1111111111111111111111111111...
Ngày tải lên: 05/08/2014, 10:20