ITSC 1213 EXAM 1 QUESTIONS AND CORRECT
ANSWERS
A class is a template for an - Answers - object
An object is an ____ of a class - Answers - instance
Class definitions have two parts - Answers - Fields and methods
What are the two types of access to class members we have done - Answers - public
and private
What is the purpose of the constructor method? - Answers - Used to initialize the
instances of a class
Creating an object is called - Answers - instantiation
A java project is made up of ____ definitions - Answers - class
A class file has two parts - Answers - fields and methods
Putting the data for an object and the methods that can access and change this data
together in the same file is called - Answers - Encapsulation
What are the two categories of data types in java - Answers - primitive and reference
The public class name in a java source code file must have the same names as the -
Answers - file name
Suppose you have written a class definition for a student class.
Write the line of code you would use to declare a reference to a student object -
Answers - Student referenceName;
Write the line of code you would use to create a Student object and assign its address
to the reference you declared. - Answers - referenceName = new Student();
What is the purpose of the mutator(setter) methods? - Answers - Stores a value in a
field or in some other way changes the value of the field
What is the purpose of accesser (getter) methods? - Answers - Get methods return a
value from an object
What are the two categories of java types - Answers - Primitave and reference
ANSWERS
A class is a template for an - Answers - object
An object is an ____ of a class - Answers - instance
Class definitions have two parts - Answers - Fields and methods
What are the two types of access to class members we have done - Answers - public
and private
What is the purpose of the constructor method? - Answers - Used to initialize the
instances of a class
Creating an object is called - Answers - instantiation
A java project is made up of ____ definitions - Answers - class
A class file has two parts - Answers - fields and methods
Putting the data for an object and the methods that can access and change this data
together in the same file is called - Answers - Encapsulation
What are the two categories of data types in java - Answers - primitive and reference
The public class name in a java source code file must have the same names as the -
Answers - file name
Suppose you have written a class definition for a student class.
Write the line of code you would use to declare a reference to a student object -
Answers - Student referenceName;
Write the line of code you would use to create a Student object and assign its address
to the reference you declared. - Answers - referenceName = new Student();
What is the purpose of the mutator(setter) methods? - Answers - Stores a value in a
field or in some other way changes the value of the field
What is the purpose of accesser (getter) methods? - Answers - Get methods return a
value from an object
What are the two categories of java types - Answers - Primitave and reference