Why does Program 3.4 bother keeping the Print method, when the program section doesn't even use it?

The way I understand it, Print was necessary in Program 3.3, because Print was a dumbed-down form of a "Get" method.

But the whole aim of Program 3.4 is to teach us how to write and use "Get" methods, right? (such as "numerator" and "denominator").

So Print doesn't even make it past the Implementation section. It's just there, staring back at me with no purpose.

// Program to access instance variables – cont'd

#import < Foundation/ Foundation.h >

//---- @interface section ----

@interface Fraction: NSObject

-( void) print;

-( void) setNumerator: (int) n;

-( void) setDenominator: (int) d;

-( int) numerator;

-( int) denominator;

@end

//---- @implementation section ----

@implementation Fraction

{

int numerator;

int denominator;

}

-( void) print

{

NSLog (@"% i/% i", numerator, denominator);

}

-( void) setNumerator: (int) n

{

numerator = n;

}

-( void) setDenominator: (int) d

{

denominator = d;

}

-( int) numerator

{

return numerator;

}

-( int) denominator

{

return denominator;

} @end

//---- program section ----

int main (int argc, char * argv[])

{

@autoreleasepool { Fraction *myFraction = [[ Fraction alloc] init];

// Set fraction to 1/ 3

[myFraction setNumerator: 1];

[myFraction setDenominator: 3];

// Display the fraction using our two new methods

NSLog (@" The value of myFraction is: %i/% i", [myFraction numerator], [myFraction denominator]);

}

return 0;

}