tags:

views:

67

answers:

3

I am confused about what the difference is between a protocol and an interface? They both seem to be doing the same thing?

Is it like abstract in C# in that you are required to implement it?

A: 

a protocol in Objective-C is the same as an interface in java, if thats what you mean

SirLenz0rlot
Is it like abstract in C# in that you are required to implement it?
yup, sort of.note that there are differences between an abstract classes and interfaces in c#.But an interface in C# is the same as an interface in Java
SirLenz0rlot
A: 

Objective-C: protocol.

Java: interface.

Otherwise, no difference.

Paul Lynch
A: 

In Objective C an interface is equivalent to a C++ class declaration. And a protocol is equivalent to a Java interface.

Edit: In Objective C the class definition is separated into two components called the interface and implementation, which allows you to shrink the header files. This is similar to C++. Java doesn't have an equivalent, because you implement your class functions within the class definition. C# is similar to Java in this respect.

Fletcher Moore