+ 1
why they have used "bool" instead of box? is it wrong if we put "box"?
4 odpowiedzi
+ 2
It would be a binary option 1 or 0 (true or false), so a boolean was chosen . I may be wrong though
+ 2
You need to declare the data type that will be returned by the function. In the example, a Box was returned, which is why Box was declared in this case. In the question, a bool is returned, (ie: true or false) which is why bool needs to be declared in this case.
+ 2
'Box' is definitly wrong, because the return value is expected. The example in the previous lection is completly misleading...
0
is a test(> < == != ....) not operation (+ - * /)