I would like to know what the @interface in objective C is? is it just where the programmer want to declare the variables, class name or method names...? I am not sure whether it is like interface in Java. And about the @protocol in objective C as well. It seems like the interface in Java more. Could anyone give me detail explanation please. I truly appreciate it.
Some low level protocols are TCP, UDP, IP, and ICMP. Some familiar examples of application layer protocols, built on these lower protocols, are HTTP (for accessing web content), SSH, TLS/SSL, and FTP. Port: A port is an address on a single machine that can be tied to a specific piece of software.
A protocol is a set of rules for communication within a layer. A service is what the layer provides to the layer above it through an interface.
A communication protocol is a system of rules that allows two or more entities of a communications system to transmit information via any kind of variation of a physical quantity. The protocol defines the rules, syntax, semantics and synchronization of communication and possible error recovery methods.
A network interface is the point of interconnection between a computer and a private or public network. A network interface is generally a network interface card (NIC), but does not have to have a physical form.
An interface is where you define the attributes and operations of class. You must set out the implementation too.
A protocol is like an interface for java.
e.g.
@protocol Printing -(void) print; @end
can be implemented
by declaring (confusingly in the interface)
@interface Fraction: NSObject <Printing, NSCopying> { //etc..
The confusing thing for java developers is that the curly braces {}
are not the end of the interface e.g.
@interface Forwarder : Object { id recipient; } //This is not the end of the interface - just the operations - (id) recipient; - (id) setRecipient:(id) _recipient; //these are attributes. @end //This is the end of the interface
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With