Computer Science 111:

Introduction to Computer Science I

Gregory M. Kapfhammer

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

Color Scheme

Key Concept

Corresponding Diagram

In-Class Discussion

In-Class Activity

Details in the Textbook

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

Refer to Section 3.1 for more details and diagrams!

String Manipulation

Real world examples of string processing?

Purpose of and ways to index a string?

See Figure 3.1 for the methods provided by String

flickr photo shared by James Jordan under a Creative Commons ( BY-NC-ND ) license

Let's Try It!

We can write a Java program to learn more about Strings

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!

Work on this programming task with your partner

If you create and fix an error, post the details in Slack!


What is a class library?

Application programming interface (API)

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

Input, compile, and run the program in Listing 3.2

Just one of the nextInt and nextFloat calls

flickr photo shared by pure9 under a Creative Commons ( BY-NC ) license