Answers 877
F
Answers for Bonus Day 4
Quiz
- Type long.
- Yes, but they are called methods.
- Either whileordo...while.
4 You use importto make other classes available in your Java program. - There are three Java comment styles:
- Anything between /and/is a comment.
- Anything on a line after //is a comment.
- Anything between /*and/is a comment.
- Java identifiers are case-sensitive, so countandCountrefers to two different
things. - Any type—there are no restrictions on data type in Java arrays.
Answers for Bonus Day 5
Quiz
- You have no choice in the matter. Constructor method always have the same name
as the class they are in. - Use extendsin the first line of a class definition to specify the parent class that the
new class will inherit from. - No. If the return type of a method is declared as void, the method does not return a
value. - Yes, as long as the different constructor methods all have a different number and/or
type of arguments. - When an instance of the class is created.
- No. If a class was created with the finalkeyword, it cannot be used as a parent
class. - The finalkeyword is used to prevent a class from being inherited from.
- No, an abstract class cannot be used to instantiate an object. You can, however,
inherit from it.
49 448201x-APP F 8/13/02 11:22 AM Page 877