Thinking in C# phần 5
➤ Gửi thông báo lỗi ⚠️ Báo cáo tài liệu vi phạmNội dung chi tiết: Thinking in C# phần 5
Thinking in C# phần 5
.NET to program Windows Forms, it will place all the code relating to constructing the user-interface into a method called IiiittaUzeCoinponent( ); th Thinking in C# phần 5 his method may be hundreds of lines long, but it contains no control-flow operators, so it's length is irrelevant. On the other hand, the 15 lines of this leap year calculation are about as complex as IS acceptable://:cO9:LeapYearCalc.csusing System;class LeapYearCalc {Static bool Leap'ieardnt year) Thinking in C# phần 5 {if (year % 4 !- 0) { return false;) else (if (year % 400 -- 0) ( return true;} else {if (year % 100 — 0) { return false;4" “ĨI 1 el!eJreturn true;1thThinking in C# phần 5
)1public static void Test (mt year, bool val) {if (val -- LeapYear(year)) {Console.writeLine(”{0} correctly calced as {1}", year, val);return;)throw n.NET to program Windows Forms, it will place all the code relating to constructing the user-interface into a method called IiiittaUzeCoinponent( ); th Thinking in C# phần 5 alse);342Thinking in c#www.ThinkingIn.NET}class TestEõiledException : ApplicationException{ public TestFailedException(String 3): base<3){ } }///:*Some simple testing code is shown because, less than a month before this book went to press, we found a bug in the LeapYearCalcf ) function had! So maybe Thinking in C# phần 5 the 15 lines in that function are a little more complex than allowable ..Make stuff as private as possibleNow that we’ve introduced the concept of coThinking in C# phần 5
upling and cohesion, the use of the visibility modifiers in c# should be more compelling. The more visible a piece of data, the more available it is t.NET to program Windows Forms, it will place all the code relating to constructing the user-interface into a method called IiiittaUzeCoinponent( ); th Thinking in C# phần 5 ET Framework do not derive from the noun.Verbf ) form of method calls or from using brackets to specify scope The success of the object-oriented paradigm stems from encapsulation, the logical organization of data and behavior with restricted access. Coupling and cohesion are more precise terms to di Thinking in C# phần 5 scuss the benefits of encapsulation, but class interfaces, inheritance, the visibility modifiers, and Properties - the purpose of all of these thingsThinking in C# phần 5
is to hide a large number of implementation details while simultaneously providing functionality and extensibility..NET to program Windows Forms, it will place all the code relating to constructing the user-interface into a method called IiiittaUzeCoinponent( ); th.NET to program Windows Forms, it will place all the code relating to constructing the user-interface into a method called IiiittaUzeCoinponent( ); thGọi ngay
Chat zalo
Facebook