Presentation is loading. Please wait.

Presentation is loading. Please wait.

PreAP Computer Science Quiz Key

Similar presentations


Presentation on theme: "PreAP Computer Science Quiz Key"— Presentation transcript:

1 PreAP Computer Science Quiz 08.04- 05 Key
Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 seconds per question.

2 Title the quiz as shown below The quiz starts in ONE minute.
Name Period Date Quiz 8. EC.

3 Question 01 Which Java keyword is used to instantiate or
construct an object? construct instantiate new create

4 Question 02 A constructor is a method. has the same name as the class.
is neither a void method nor a return method. is all of the above.

5 Question 03 Which of the following statements is true?
A class can have only one constructor. Overloaded constructors have the same signature. A class can have multiple constructors. Constructors make a class less reliable.

6 Question 04 Class members need to be declared as private or public.
overloaded. constructors. attributes.

7 Question 05 Class members that are declared private can
only be accessed by members of the same class. only be accessed by members of the same file. be accessed from anywhere. never be accessed.

8 Question 06 Class members that are declared public can
only be accessed by members of the same class. only be accessed by members of the same file. be accessed from anywhere. never be accessed.

9 Question 07 Class attributes are usually declared public. private.
final. in a different file from the class methods.

10 Question 08 Class methods are usually declared public. private. final.
in a different file from the class attributes.

11 Question 09 What is true of the program code below? class Bank { }
It is an incomplete class, which cannot compile. It is a minimum class, which does compile. It is the Bank constructor. It is an overloaded method.

12 Question 10 What is shown by the two program statements?
Bank tom = new Bank(); Bank sue = new Bank(1000.0,5000.0); Overloading constructors Void methods Return methods Class Interaction

13 Question 11 The Bank class is an example of a class that uses
object methods. overloaded constructors. void methods. return methods. all of the above.

14 Question 12 Which method is neither a return method nor a void method?
A public method A class method An object method A constructor method

15 Question 13 Accessing or get methods are used to
retrieve attribute values. alter attribute values. initialize attribute values. destroy attribute values.

16 Question 14 Modifier, Mutator or set methods are used to
retrieve attribute values. alter attribute values. initialize attribute values. destroy attribute values.

17 Question 15 Constructor methods are used to retrieve attribute values.
alter attribute values. initialize attribute values. destroy attribute values.

18 Piggy tom = new Piggy();
Extra Credit Consider the statement below. Piggy tom = new Piggy(); The first Piggy is the class name. What is the second Piggy identifier? A second class name The constructor name The class parameter The object name


Download ppt "PreAP Computer Science Quiz Key"

Similar presentations


Ads by Google