0% found this document useful (0 votes)
38 views

CPSC 231 Exam2 Study Guide

Exam 2 will focus on user-defined methods, classes, arrays, recursion, and generics/collections in Java. Specifically, it will test knowledge of declaring methods, classes and objects, instance variables, constructors, static methods/variables, information hiding, references, arrays, recursion, and the ArrayList and LinkedList classes. Students should study their lecture notes, textbook, and this study guide to review the outlined topics in preparation for the exam.

Uploaded by

Daniel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

CPSC 231 Exam2 Study Guide

Exam 2 will focus on user-defined methods, classes, arrays, recursion, and generics/collections in Java. Specifically, it will test knowledge of declaring methods, classes and objects, instance variables, constructors, static methods/variables, information hiding, references, arrays, recursion, and the ArrayList and LinkedList classes. Students should study their lecture notes, textbook, and this study guide to review the outlined topics in preparation for the exam.

Uploaded by

Daniel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CPSC 231 Study Guide

Exam 2 will focus on the topics mentioned below. Please make sure to study the material
referenced in this study guide. Although an effort has been made to try and cover all the
material outlined below, please review lecture notes/textbook if a topic was not
mentioned.
● The exam assumes you are able to program efficiently in Java
● While not a focus, the exam may draw on material from earlier in the course that
was tested on exam 1.

User Defined Methods


● Declaring methods
○ reason for methods
○ return types
○ print methods
○ methods with branching
○ methods with loops
○ Overloading
■ Rules for Overloading
○ Recursive Methods
Intro to Classes
● Class Definitions
○ Instance Variables and Methods
○ Local Variables
○ Variable Scope
○ Code Blocks
○ Parameters of a Primitive Type
○ The this Parameter
○ Methods that Return a Boolean Value
○ The Methods equals and toString
● Information Hiding and Encapsulation
○ public and private Modifiers
○ Accessor and Mutator Methods
● Constructors
○ Constructor Definitions
○ Default Variable Initializations
● Static Methods and Static Variables
○ Static Methods
○ Static Variables
○ The Math Class
● Wrapper Classes
○ Automatic Boxing and Unboxing
○ Static Methods in Wrapper Classes
● References and Class Parameters
○ Variables and Memory
○ References
○ Class Parameters
○ The new Operator
Arrays
● Introduction to Arrays
○ Creating and Accessing Arrays
○ The length Instance Variable
○ Initializing Arrays
● Arrays and References
○ Arrays are Objects
○ Arrays Parameters
○ Arguments for the Method main
○ Methods that Return an Array
● Programming with Arrays
○ Partially Filled Arrays
○ Methods with a Variable Number of Parameters
● Multidimensional Arrays
○ Multidimensional Array Basics
○ Using the length Instance Variable
Recursion
● Recursive void Methods
○ Tracing a Recursive Call
○ A Closer Look at Recursion
○ Stacks for Recursion
○ Recursion versus Iteration
Generics/Collections
● The ArrayList Class
○ Using the ArrayList Class
○ Methods in the class ArrayList
○ The For-Each Loop
● Linked List Class
○ Using the Linked List Class
○ Methods in the class LinkedList
○ The For-Each Loop

You might also like