Quiz
Computer Science Quiz: Writing Custom Classes
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (10)
1An object has...?
- AState and Behaviour.
- BActions and Classes.
- CMethods and Code.
2How many objects can a class have?
- A234
- B2
- CAs many as we want
- D100
3What type of declarations need to be made by a class?
- AState and Behavior
- BClass and Object
- CData and Method
4What is the toString method?
- AA method that makes two strings.
- BA method that combines two strings.
- CA method that prints a string representation of an object.
- DA method that returns a string representation of an object.
5What is a constructor?
- AA person who directs a choir or orchestra.
- BA person who builds buildings
- CA method used to set up an object upon its creation.
- DA method used to build a class.
6How is a constructor called and how is it named?
- AIt is called by java and is also named by java.
- BIt is called by a line of code and is named by the author.
- CIt is called by a line of code and shares the name of the class.
- DIt is called via "new" and shares the name of the class.
7A constructor can accept parameters if necessary.
- ATrue
- BFalse
8What is the scope of a variable?
- AWhat the variable can apply to.
- BHow many times the variable can be used.
- CThe region of the program that the variable can be used within.
- DThe accuracy of the variable.
9What is an instance variable?
- AA variable that only is used once.
- BA copy of a variable that is given to each object.
- CA variable that only applies to one instance (object).
- DA copy of a variable that applies to all objects in a program.
10A client should be aware of both the implementation details as well as the interface.
- ATrue
- BFalse
Information
- Description
- Quiz on Computer Science Quiz: Writing Custom Classes, created by Chris Fraser on 06/11/2014.
- Author
- Chris Fraser
- Language
- English
- Views
- 44
- Rating
- 5.0 out of 5 · 1 rating Rate this quiz