< Objective-J
- Objective-J has two types of objects, native JS objects and Objective-J objects.
- Native JS objects are exactly what they sound like, the objects native to JavaScript.
- Objective-J objects are a special type of native object added by Objective-J. These new objects are based on classes and traditional inheritance, like C++ or Java, instead of the prototype model.
Creating a class
Here's an example of a Person class that contains one member variable, name:
@implementation Person : CPObject
{
CPString name;
}
@end
This article is issued from
Wikibooks.
The text is licensed under Creative
Commons - Attribution - Sharealike.
Additional terms may apply for the media files.