Computer Science Quiz: Writing Custom Classes

Description

Quiz on Computer Science Quiz: Writing Custom Classes, created by Chris Fraser on 06/11/2014.
Chris Fraser
Quiz by Chris Fraser, updated more than 1 year ago
Chris Fraser
Created by Chris Fraser over 9 years ago
29
0

Resource summary

Question 1

Question
An object has...?
Answer
  • State and Behaviour.
  • Actions and Classes.
  • Methods and Code.

Question 2

Question
How many objects can a class have?
Answer
  • 234
  • 2
  • As many as we want
  • 100

Question 3

Question
What type of declarations need to be made by a class?
Answer
  • State and Behavior
  • Class and Object
  • Data and Method

Question 4

Question
What is the toString method?
Answer
  • A method that makes two strings.
  • A method that combines two strings.
  • A method that prints a string representation of an object.
  • A method that returns a string representation of an object.

Question 5

Question
What is a constructor?
Answer
  • A person who directs a choir or orchestra.
  • A person who builds buildings
  • A method used to set up an object upon its creation.
  • A method used to build a class.

Question 6

Question
How is a constructor called and how is it named?
Answer
  • It is called by java and is also named by java.
  • It is called by a line of code and is named by the author.
  • It is called by a line of code and shares the name of the class.
  • It is called via "new" and shares the name of the class.

Question 7

Question
A constructor can accept parameters if necessary.
Answer
  • True
  • False

Question 8

Question
What is the scope of a variable?
Answer
  • What the variable can apply to.
  • How many times the variable can be used.
  • The region of the program that the variable can be used within.
  • The accuracy of the variable.

Question 9

Question
What is an instance variable?
Answer
  • A variable that only is used once.
  • A copy of a variable that is given to each object.
  • A variable that only applies to one instance (object).
  • A copy of a variable that applies to all objects in a program.

Question 10

Question
A client should be aware of both the implementation details as well as the interface.
Answer
  • True
  • False
Show full summary Hide full summary

Similar

Quiz Geral
miminoma
GCSE English Literature: Of Mice and Men
mia.rigby
The First, Second, Third and Fourth Crusades
adam.melling
Metallic bonding
anna.a.graysmith
Summary of AS Psychology Unit 1 Memory
Asterisked
Biological Psychology - Stress
Gurdev Manchanda
GCSE AQA Physics Unit 2 Flashcards
Gabi Germain
GCSE REVISION TIMETABLE
megangeorgia03
Using GoConqr to study geography
Sarah Egan
General questions on photosynthesis
Fatima K
GENERAL PRACTICE-1
Luis Felipe Chávez Choque