49.1k views
5 votes
In a general sense, a method is:

A. a plan
B. a statement inside a loop
C. a comment
D. a collection of statements that performs a specific task

User Staven
by
3.1k points

1 Answer

6 votes

Answer:

D. a collection of statements that perform a specific task.

Step-by-step explanation:

A method, also called function, is a sequence of statements used to perform a specific task. A function or method uses parameters to perform its task and may or may not return a value. For example, a method can be written to find the area of a rectangle where the parameters will be the length and breadth of the rectangle.

A method is not exactly a plan neither is it a statement inside a loop as any statement can be in a loop. A method is not a comment as a comment is just used to enhance the readability of a code and are not even executed.

Hope this helps!

User Teario
by
3.1k points