Page 819 - AP Computer Science A, 7th edition
P. 819

19. (C) Notice that isValidTemp is a static method for the Temperature class, which means that it cannot be invoked with a Temperature object. Thus, segment I is incorrect: t.isValidTemp is wrong. Segment II fails because isValidTemp is not a method of the TempTest class. It therefore must be invoked with its class name, which is what happens (correctly) in segment III: Temperature.isValidTemp.


































































































   817   818   819   820   821