- 博客(3)
- 资源 (3)
- 收藏
- 关注
原创 如何写漂亮的返回值为 boolean 类型的方法
<br />public boolean isLow() { if ((myGasoline + myBattery) < 10) { return true; } else { return false; } }<br />更漂亮的:<br />public boolean isLow() { // Compute (true or false) if we are low, // and return that
2011-05-12 18:01:00
1569
原创 Boolean Precedence
<br />Boolean PrecedenceThe above examples use parentheses to spell out the order of operations. The boolean not ! has a high precedence -- in (!a && b) the ! is evaluated on the a, before the &&. We could add in parenthesis (!(a && b)) to force the && to
2011-05-12 17:22:00
313
原创 求更精的代码!
<br /><br />/* * File: Pyramid.java * ------------------ * This program is a stub for the Pyramid problem, which draws * a brick pyramid. */ import acm.program.*; import acm.graphics.*; import java.awt.*; public class Pyramid extends Graphics
2011-04-21 22:07:00
291
PHP CookBook 3rd Edition
2014-11-23
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅