Computer Science 111:

Introduction to Computer Science I

Chapter Three

Gregory M. Kapfhammer

creative commons licensed ( BY-NC-SA ) flickr photo shared by Ed Yourdon

Objects and Primitives

Similarities and differences?

Can you create a list for both of these?

What does this look like in memory?

Aliases for reference variables

String Manipulation

How do we index a String?

What are the methods provided by String?

Let's try it! We can write a Java program.

Input the program in Listing 3.1 on page 120

Can you explain the output of this program?

Now, change the replacement and the substring!


What is a class library?

Application programming interface

What are some examples of packages?

Check the online documentation!

Make sure to use an import!

Let's explore a new package!

Random Numbers

Provided by java.util.Random

Calculations based on a seed value

Please input the program in Listing 3.2

To simplify: Just one of the nextInt and nextFloat calls