Uploaded by ozfouxgandlizgpxdn

Barron's Chapter 3 #1-10

advertisement
Niki Sahoo
8/5/2021
I certify the work I am submitting is my original work.
I have not shared, nor exchanged information or materials with anyone, nor will I do so in the future.
Barron's Ch3 #1-10
1.
D - there are only 3 constructors, the constructor public Time() only appears twice in
the program.
2. B - answer choice assigns the instance variables to each parameter
3. C - I is wrong because it refers to T instead of t, II is wrong because private data cannot
be accessed.
4. C - the parameter name can be the same but the method name + parameter types have
to be different.
5. B - the constructed class should have the word new and have the constructor of the Data
class on the right of the assignment statement
6. C - A method is invoked with a null reference.
7. E - Option E has no parameter call
8. E - All options can be used as implementation code. III prints the current Data object.
9. A - Option A uses a new variable for each month, day, and year,option 2 uses parameter
values that can be assigned to new values. 3 tries to access private instance variables.
10. A - the keyword new must be used to create a new object.
Download