ExamVeda
Login
Home
This question belongs to PHP Object Oriented Concept
Object Oriented Concept
?

Which of the following is/are the right way to declare a method?
1. function functionName() { function body }
2. scope function functionName() { function body }
3. method methodName() { method body }
4. scope method methodName() { method body }

Answer & Solution
Correct Answer: Option C
In case of public methods, you can forgo explicitly declaring the scope and just declare the method like you would a function.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.