It's going to let us bury away the specifics of something, and treat that computation like a black box. And by black box, I mean, literally behaves like a mysterious little black box.
通过抽象我们可以将一些细节,掩埋起来并将这一段计算当成黑盒,说到黑盒我的意思就是,字面上的像一个神秘的小黑盒。
So you're implementing this black box, and if its purpose in life is to actually return a value, you have to tell the compiler what kind of value to expect, and this is going to have ripple effects.
你在实现这个黑盒子,如果它的目的是,返回一个值,你必须告诉编译器你期望的是什么类型的值,这个将是一个连锁反应。
The military staff carries the black box.
军事人员带着黑盒子。
They were looking down into a lowered place, where something white was lying, squirming a little, in a box lined with black cloth.
他们在往低处看,在一个围着黑布的箱子里,好像有什么白色的东西躺在里面,微微地蠕动,在很短的时间内。
So just to hammer home this point, for now, a function really is like a black box.
现在再三强调,让你们彻底了解这一点,一个函数就像是一个黑盒子。
Think of it as a black box.
把它想象成一个黑盒子。
So we'll talk a bit more about this idea of functions today, but, get int, again, can think of it as a black box, whose purpose in life is to prompt the human for input and pester the human if he or she doesn't actually give it int, but then once it has that, has entered it from the user, it's quote unquote, returns it to you.
所以我们进今天将多讨论点这个函数的概念,但是,GetInt,我们可以把它当做一个黑盒子,它的唯一目的是提示人们来输入,并且如果他或她没有,给它int数,则会纠缠用户,但是一旦它得到了,用户输入的int数,对输入进行引用,返回给你。
应用推荐