Answer the following statements true (T) or false (F)

1. A method must always return a result to the method’s caller.
2. Two types of methods exist: subroutines and functions.
3. Method arguments can be constants, variables or more involved expressions.
4. The header for a function must define the return type of the value to be returned.
5. The Return statement must occur at the end of a method for it to operate correctly.
6. A function can return multiple values.


1. False. A method doesn’t have to return a value. It may simply perform its task then return control to the caller.
2. True.
3. True.
4. True.
5. False. A Return statement can occur anywhere in the method body.
6. False. A function returns exactly one value.

Computer Science & Information Technology

You might also like to view...

An administrator is attempting to restore a number of files in a directory within the Operating System of a virtual machine. How can the administrator restore the files from a previous backup?

A. Use the File Level Restore option from the selected backup of the virtual machine in the vSphere Web Client. B. Connect to the File Level Restore tool from a web browser in the virtual machine. C. Connect to the File Level Restore tool from the VMware Data Protection appliance. D. Use the File Level Restore option from the selected backup of the virtual machine in the vSphere Client.

Computer Science & Information Technology

The Web consists of documents called Web pages that are stored on Web servers.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology