Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class Pizza {
- public static final Pizza.NULL = new Pizza() {
- /* "null" implementations */
- }
- /* actual/abstract implmentations */
- }
- @interface NullPizza : NSObject
- {
- }
- - (BOOL)areYouANullPizza;
- @end
- @interface Pizza : NullPizza
- {
- }
- + (Pizza*)Null;
- @end
- @implementation Pizza
- + (Pizza*)newNullPizza
- {
- return [[NullPizza]alloc init]; // Singleton code left as an exercise.
- }
- - (BOOL)areYouANullPizza;
- {
- return NO;
- }
- @end
Add Comment
Please, Sign In to add comment