Monday, 15 April 2013

objective c - What are instance variables -



objective c - What are instance variables -

so question simple. i'm bit confused inheritance of instance variables.

so know sure local variables exist in method, , can not accessed outside method or other class. (correct me if wrong)

properties. public variables , inherited subclass , super class , can accessed directly.(correct me if wrong)

in case of instance variables. private class , can accessed other subclasses or superclass in methods using // self.ivar [self ivar]// right? , value can not access straight outside of class. declared in method local variables difference can retain mutable value.

someone please right me, sense wrong right no.

oh 1 lastly question... instance of class object right?

in object-oriented programming, instance variable variable defined in class (i.e. fellow member variable), each object of class has separate copy, or instance. instance variable similar , contrasts class variable. example:

struct request { static int count; int number; request() { number = count; // modifies instance variable "this->number" ++count; // modifies class variable "request::count" } }; int request::count = 0;

objective-c inheritance instance-variables

No comments:

Post a Comment