- Beginning C# 7 Hands-On:Advanced Language Features
- Tom Owsiak
- 164字
- 2021-07-02 15:29:17
Modifying the program for an additional type of comparison
Now, go back to Default.aspx and, in the next stage, in the Design view, we will also compare those values. For this, double-click on the Exchange and Compare button again and add the following beneath the last line we entered:
sampLabel.Text += GenMethods.Compare<double>(x, y);
Remember that the way we designed Compare, it returns a string that returns one of the two values, depending on the specifics. So, in this line we will compare double; so you put that in there and then the two values will be x, y.
Let's give it a shot in your browser. Click on the Exchange and Compare button once again. The new results are shown in Figure 2.2.5:

Figure 2.2.5: Results of the modified program run
Now, x is 25 and y is 34. When you exchange the values, x is 34 and y is 25. Further, 34 is certainly more than 25. It looks really nice and professional.
推薦閱讀
- INSTANT Mock Testing with PowerMock
- JavaScript:Functional Programming for JavaScript Developers
- 編程卓越之道(卷3):軟件工程化
- Network Automation Cookbook
- Servlet/JSP深入詳解
- Java Web程序設(shè)計(jì)
- FFmpeg入門詳解:音視頻原理及應(yīng)用
- Mastering ServiceNow(Second Edition)
- 組態(tài)軟件技術(shù)與應(yīng)用
- Java系統(tǒng)化項(xiàng)目開(kāi)發(fā)教程
- Android應(yīng)用案例開(kāi)發(fā)大全(第二版)
- INSTANT Yii 1.1 Application Development Starter
- Python Machine Learning Blueprints:Intuitive data projects you can relate to
- Android應(yīng)用開(kāi)發(fā)實(shí)戰(zhàn)(第2版)
- SwiftUI極簡(jiǎn)開(kāi)發(fā)