Topic: Here's how we program in Java. Actually, this is just the C-ish subset of Java; it is not much object-oriented. We will look into the object-oriented features in Chapters 1–3.

Examples Developed in Class

August 27, 2012

These examples are also available on merlin.iue.edu in the directory /home/info/share/c243/java-review-2012-08-27

Discussion Notes

Appendix A: Java Review

A1 First Program

A2 Variables and Types

A3 Loops

A4 User Interaction

p. 526 Creating a Scanner (java.util.Scanner)

A5 Branching

Recursion

We can use the if statement to define recursive functions. - Explain recursion, base case, recursive step. - Example, to be developed in class: computing 2n. - Solution: PowerOf2.java (restricted access)

A6 Methods

A7 Constants

(Ask)

A8 Operators

p. 536: Exercises A17–A20

A9 Debugging

A10 Coding Conventions

(Have a look at our coding standards.)

Revision log