difference between function protocol and function definition
Answers
Answered by
3
Answer:
A procedure is compiled once and can be called multiple times without being compiled.
Answered by
8
A function is something that you write to bundle a bunch of instructions together and make the computer perform some kind of task. It’s exactly like the functions in Java, C++, Python or any other language.
A method is a function, but it’s contained within an object and to be able to call it, you need to chain it onto an object of a class where the method is defined.
A protocol is much like an interface in Java. It’s used to declare methods that the classes that implement the protocol needs to define in order to conform to that specific protocol. If they don’t define them all, they can’t implement the protocol, it’s all or nothing.
Similar questions