Vidyalelo
PHP · Q6

Object Oriented Concept

Programming · PHP · question 6

Q6

Which keyword precedes a method name?

A.
method
B.
function
Answer
C.
public
D.
protected

Answer: Option B

Solution

Answer: Option B
Solution:
A method declaration resembles a function declaration. The function keyword precedes a method name, followed by an optional list of argument variables in parentheses.