Exam 4 Study Guide

 

Covers Week07_Notes01 – Week09_Notes02.

Lab 7

String methods

·         indexOf(), charAt(), and length()

·         What do each of these take and what do they return.

·         Given a string object, be able to write statements using these methods and know what they would return when the string object executes them.

·         Know the difference between a String and a char. 

Objects

·         What keyword is used to create an object?

·         Know what a constructor method is and when it is called.

·         How is a constructor different from a normal method.

·         Be able to write a statement that would create an object given the class that will serve as the blueprint for this object.  (Includes finding the constructor in the class and being able to pass values of the correct type to this constructor.)

 

·         Know what instance (global) variables are -- they store data that can be used by any method in the class.

Random

·         Know how to create a random number generator.

·         What is a seed and how is it used?

·         Know how to get a random number from a random number generator.

For loops

·         What is the control flow for a for loop, i.e., what statements execute in what order?

·         What is the loop counter initialization statement?

·         The post body action statement?

 

·         Given a for loop, what will print?

·         Here is a set of problems similar to what will be on the test: ../demos/loops.htm

 – includes both for and while loops.

 

Arrays

·         Know how to declare an array object

·         write a value to the bucket at a particular index in the array

·         read an element from the bucket a particular index in the array