hello I am very new to greenfoot and I have been doing discussions a lot lately so can you please do a simple explanation about boolean and return
Boolean: the boolean data type has only two possible values: true and false. Use this data type for simple flags that track true/false conditions.
Return: the return statement is used to immediately exit a method. In a method whose return type is declared void, it is used to force an immediate exit so that the following lines of code in the method do not execute. In a method with a non-void return type, the return statement MUST be used to exit the method AND must be followed by the value to return, which must be of that declared return type. Note that for Object types, null can be a returned value.
hello I am very new to greenfoot and I have been doing discussions a lot lately so can you please do a simple explanation about boolean and return
Boolean: the boolean data type has only two possible values: true and false. Use this data type for simple flags that track true/false conditions.
Return: the return statement is used to immediately exit a method. In a method whose return type is declared void, it is used to force an immediate exit so that the following lines of code in the method do not execute. In a method with a non-void return type, the return statement MUST be used to exit the method AND must be followed by the value to return, which must be of that declared return type. Note that for Object types, null can be a returned value.