PHP2e_Chapter10_ReviewQuestions

True/False
Indicate whether the statement is true or false.

____	1.	The term object-oriented programming (OOP) refers to the concept of merging related variables and functions into a single interface.

____	2.	The term object specifically refers to programming code and data that can be treated as an individual unit or component.

____	3.	Data are often also called components.

____	4.	The term data refers to information contained within objects or other types of storage structures

____	5.	The functions associated with an object are called methods.

____	6.	Variables that are associated with an object are called properties or attributes.

____	7.	Objects are encapsulated, which means that all code and required data are contained within the object itself.

____	8.	An interface refers to objects that are required for a source program to communicate with data.

____	9.	In object-oriented programming, the code, methods, attributes, and other information that make up an object are organized into classes.

____	10.	An instance is an object that has been created from an existing class.

____	11.	When you delete an object from an existing class, you are said to be instantiating the object.

____	12.	Class names in PHP usually begin with a lowercase letter.

____	13.	A class constructor is a special attribute with the same name as its class that is called automatically when an object from the class is instantiated.

____	14.	After you instantiate an object, you use a hyphen and a greater-than symbol (->), referred to as member selection notation, to access the methods and properties contained in the object.

____	15.	The term data structure refers to a system for organizing classes.

____	16.	The functions and variables defined in a class are called functional members

____	17.	Class variables are referred to as data members or member variables.

____	18.	Class functions are referred to as data members or member data.

____	19.	To create a class in PHP, you use the class keyword to write a class definition, which contains that data members and member functions that make up the class.

____	20.	The term, garbage collection, refers to cleaning up, or reclaiming, memory that is reserved by a program.

____	21.	The principle of information hiding states that any class members that other programmers, sometimes called clients, do not need to access or know about should be hidden.

____	22.	Access specifiers control a client’s access to individual data members and member functions.

____	23.	There are three levels of access specifiers in PHP:  public, private, and protected.

____	24.	The public access specifier allows anyone to call a class’s member function or to modify or retrieve the value of a data member.

____	25.	Serialization refers to the process of converting an object into binary data that you can store for reuse.

____	26.	A constructor function is a special function that is called automatically when an object from a class is instantiated.

____	27.	A destructor function cleans up any resources allocated to an object after the object is destroyed.

____	28.	Accessor functions are private member functions that a client can call to retrieve or modify the value of a data member.

____	29.	When you serialize an object with the serialize() function, PHP looks in the object’s class for a special function named __sleep() function, which you can use to perform many of same tasks as a destructor function.

____	30.	Although the destructor function is always called, a constructor function is only called when you instantiate a new class object.

Multiple Choice
Identify the choice that best completes the statement or answers the question.

____	31.	Reusable software objects that can be incorporated into multiple programs is called ____. 
a.	object-based programming	c.	snipets	
b.	object-oriented programming	d.	functions	

____	32.	Programming code and data that can be treated as an individual unit or component is known as a(n) ____.
a.	method	c.	attribute	
b.	function	d.	object	

____	33.	Objects are often called ____.
a.	components	c.	reusable code	
b.	properties	d.	functions	

____	34.	Information contained within variables is called ____.
a.	code	c.	components	
b.	data	d.	objects	

____	35.	____ are functions associated with an object.
a.	Properties	c.	Methods	
b.	Data	d.	Return functions	

____	36.	____ are variables associated with an object.
a.	Properties	c.	Elements	
b.	Components	d.	Parameters	

____	37.	Objects in which all code and required data are contained within the object itself are ____.
a.	instances	c.	null	
b.	contained	d.	encapsulated	

____	38.	Methods and properties that are required for a source program to communicate with an object are referred to as a(n) ____.
a.	interface	c.	function	
b.	attribute	d.	class	

____	39.	Objects are organized into ____.
a.	programs	c.	functions	
b.	instances	d.	classes	

____	40.	An object created from an existing class is called a(n) ___
a.	method	c.	instance	
b.	property	d.	variable	

____	41.	____ the object means creating an object from a class.
a.	Editing	c.	Instantiating	
b.	Threading	d.	Copying	

____	42.	A particular instance of an object ____ the methods and properties its class.
a.	cancels	c.	creates	
b.	inherits	d.	instantiates	

____	43.	When an object from the class is instantiated it automatically calls a(n) ____, which is a special function with the same name as its class. 
a.	class constructor	c.	attribute	
b.	method	d.	member function	

____	44.	A hyphen and a greater-than symbol used to access the methods and properties contained in an object are referred to as ____.
a.	class	c.	selector	
b.	member selection notation	d.	data structure	

____	45.	____ is a system for organizing data.
a.	Programming	c.	Data structure	
b.	Database Storage	d.	Class creation	

____	46.	____ are the functions and variables defined in a class.
a.	Constructors	c.	Function Members	
b.	Methods	d.	Class Members	

____	47.	Class variables are known as ____.
a.	class members	c.	classmates	
b.	data members	d.	parameters	

____	48.	Class functions are called ____.
a.	methods	c.	function members	
b.	constructors	d.	class members	

____	49.	To create a class in PHP, use the ____ keyword to write a class definition.
a.	definition	c.	create	
b.	class	d.	construct	

____	50.	The ____ portion of the class definition is the name of the new class.
a.	Definition	c.	MemberClass	
b.	Object	d.	ClassName	

____	51.	Use the ____ comparison operator to determine whether an object is instantiated from a given class.
a.	instanceof	c.	objectof	
b.	classof	d.	memberof	

____	52.	The ____ function determines whether a class exists and is available to the current script.
a.	object_exists()	c.	class_exists()	
b.	get_class()	d.	member_exists()	

____	53.	Cleaning up, or reclaiming memory that is reserved by a program is called ___
a.	housekeeping	c.	refreshing	
b.	garbage collection	d.	flushing	

____	54.	Class members that other programmers do not need access to should be ____.

a.	hidden	c.	saved	
b.	deleted	d.	copied	

____	55.	To enable anyone to call a class’s member function use a(n) ____.
a.	private access specifier	c.	hidden access specifier	
b.	public access specifier	d.	open access specifier	

PHP2e_Chapter10_ReviewQuestions
Answer Section

TRUE/FALSE

	1.	REF:	557

	2.	REF:	557

	3.	REF:	557

	4.	REF:	557

	5.	REF:	557

	6.	REF:	557

	7.	REF:	559

	8.	REF:	559

	9.	REF:	560

	10.	REF:	560

	11.	REF:	560

	12.	REF:	561

	13.	REF:	563

	14.	REF:	564

	15.	REF:	573

	16.	REF:	573

	17.	REF:	573

	18.	REF:	573

	19.	REF:	575

	20.	REF:	578

	21.	REF:	578

	22.	REF:	580

	23.	REF:	580

	24.	REF:	580

	25.	REF:	582

	26.	REF:	585

	27.	REF:	587

	28.	REF:	588

	29.	REF:	594

	30.	REF:	595

MULTIPLE CHOICE

	31.	REF:	557

	32.	REF:	557

	33.	REF:	557

	34.	REF:	557

	35.	REF:	557

	36.	REF:	557

	37.	REF:	559

	38.	REF:	559

	39.	REF:	560

	40.	REF:	560

	41.	REF:	560

	42.	REF:	561

	43.	REF:	563

	44.	REF:	564

	45.	REF:	573

	46.	REF:	573

	47.	REF:	573

	48.	REF:	573

	49.	REF:	575

	50.	REF:	575

	51.	REF:	575

	52.	REF:	576

	53.	REF:	578

	54.	REF:	579

	55.	REF:	580