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

9. (A) The idea here is to read in three separate variables for month, day, and year and then to construct the required date using new and the Date class constructor with three parameters. Code segment II won’t work because month(), day(), and year() are accessor methods that access existing values and may not be used to read new values into bDate. Segment III is wrong because it tries to access private instance variables from a client program.


































































































   797   798   799   800   801